django

Warnings (or even info messages) instead of only errors in Django

Does the concept of severity exist in Django's form validation or is it only errors? Also, how about suppressing warnings/errors? ...

Subscription web/desktop app [PYTHON]

Hi, Firstly pardon me if i've yet again failed to title my question correctly. I am required to build an app to manage magazine subscriptions. The client wants to enter subscriber data and then receive alerts at pre-set intervals such as when the subscription of a subscriber is about to expire and also the option to view all subscriber ...

Why Django does not create full table from a model?

I have 2 models. I run manage.py syncdb but it creates only id fields for 2 models. How to make it generate the remaining fields? Please kindly advise. Your help is much appreciated! Here's my models.py: from django.db import models GENDER_CHOICES = ( ('M', 'Male') , ('F', 'Female') ) ACTIVATION_CHOICES = ( ('Y', 'Activat...

Compound/Composite primary/unique key with Django

How to create models and tables with Compound/Composite primary/unique key with Django? ...

Django: using ForeignKeyRawIdWidget outside of admin forms [Solved]

I'm trying to find some documentation of how to use the ForeignKeyRawIdWidget in my own forms. Currently I keep getting the error, "init() takes at least 2 non-keyword arguments (1 given)" which tells me nothing. Any help would be most appreciated. Googling this turns up little but dev conversations and no examples that I can find of ho...

django calendar free/busy/availabilitty

I am trying to implement a calendar system with the ability to schedule other people for appointments. The system has to be able to prevent scheduling a person during another appointment or during their unavailable time. I have looked at all the existing django calendar projects I have found on the internet and none of them seem to have...

How do I change a language of a particular page in Django website

Django internationalization allows me to set a language code either in settings file (site-wide) or on per-user / per-session basis. How can I change language for a particular page? I wrote a middleware that sets request.LANGUAGE_CODE the way I want it to be translated, but nothing seems to use this attribute to do the selected transla...

Extending/Subclassing admin Groups & Users classes in Django

I'd like to extend/subclass admin Groups & Users classes in Django. CourseAdmin group should be doing what admin can do, and they have extra information like email, phone, address. CourseAdmin should be able to create CourseAdmins, Teachers, Courses and Students. Teacher should be able to edit courses and students belong to them. They ...

Adding forgot-password feature to Django admin site

How to add the forgot-password feature to Django admin site? With email/security question options? Is there any plug-in/extension available? ...

Sortable table columns in django

I want to have sortable columns in my tables (just like what is done for the admin changelists)....I'm looking for a solution that will be easy to implement and customize if I want. How can I do this? ...

Creating first Django project using jython.

I am trying to create my 1st project in django using jython. I am following this tutorial - http://docs.djangoproject.com/en/dev/intro/tutorial01/. As mentioned in tutorial, I navigate to the directory where i intend to create a django project and run 'jython C:\jython2.5.1\Lib\site-packages\django\bin\django-admin.py'. On pressing ent...

DJANGO Python-ldap UNWILLING TO PERFORM {'info': '00002077: SvcErr: DSID-031907B4, problem 5003 (WILL_NOT_PERFORM), data 0\n', 'desc': 'Server is unwilling to perform'}

My Django application using python-ldap library (ldap_groups django application) must add users against an Active Directory on a Windows 2003 Virtual Machine domain. My application running on a Ubuntu virtual Machine is not member of the Windows domain: Here is the code: settings.py DNS_NAME='IP_ADRESS' LDAP_PORT=389 LDAP_URL='ldap:/...

How about having a SingletonModel in Django?

I'm making a very simple website in Django. On one of the pages there is a vertical ticker box. I need to give the client a way to edit the contents of the ticker box as an HTMLField. The first way that came to mind was to make a model Ticker which will have only one instance. Then I thought, instead of making sure manually that only on...

Overwrite auto_now for unittest

I've defined some timestamps for events in the database as auto_now_add, as the information should be stored with it's timestamp the same time the event is stored. The description of the events is something like class NewEvent(models.Model): ''' Individual event ''' name = models.CharField(max_length=100) quantity =...

django access logged in user in custom manager

Hi, I want to access the currently logged in user in a custom manager I have wrote. I want to do this so that I can filter down results to only show objects they have access to. Is there anyway of doing this without actually passing it in? Something similar to how it works in views where you can do request.user. Thanks ...

Django alphanumeric sort in order_by

Hi My question is exactly like this one, except that it's a query returned in Django. I want the fields returned by text_all = RawText.objects.filter(id__contains=county.short_code).order_by('id') to be returned as 1,1 2,1 10,1 rather than: 1,1 10,1 2,1 What can I do? N.B. ID is a char field, it has to be because of the comm...

Why User model inheritance doesn't work properly?

I'm trying to use a User model inheritance in my django application. Model looks like this: from django.contrib.auth.models import User, UserManager class MyUser(User): ICQ = models.CharField(max_length=9) objects = UserManager() and authentication backend looks like this: import sys from django.db import models from django...

Problem with facebook connect button in chrome (we are using django and django-socialauth)

We are using django and django-socialauth for auth with google/fb/twitter but there is a problem with the facebook connect button only in chrome (neither safari), dont shows the button. ...

Where to put Python files to be redirected to by urls.py in Django?

Where do I put python files to be redirected to by urls.py in Django? The tutorial showed something like this: urlpatterns = patterns('', (r'^polls/$', 'mysite.polls.views.index'), Where do I set up pages to be easily linked as something.something.page like this? I am currently just trying to drop straight .py files in random...

Why does django not do for the User model the same as it does for the userprofile model?

Why doesn't django just have the model to use for User configured in the settings file? The requirements on the model specified would be that it contain a certain set of fields. Is there a reason why it couldn't be done this way? ...