prem
unread,Mar 23, 2012, 5:41:26 PM3/23/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I'm using Django forms and need to create a list box.
What would be the equivalent of listbox in Django form fields?
Here is my code snippet,
Models.py
class Volunteer(models.Model):
NO_OF_HRS = (('1','1') ('2','2'))
datecreated = models.DateTimeField()
volposition = models.CharField(max_length=300)
roledesc = models.CharField(max_length=300)
Duration = models.CharField(choices=NO_OF_HRS,max_length=1)**
forms.py
class VolunteerForm(forms.ModelForm)
datecreated = forms.DateField(label=u'Creation Date')
volposition = forms.CharField(label=u'Position Name',
max_length=300)
roledesc = forms.roledesc(label=u'Role
description',max_length=5000)
Duration =
forms.CharField(widget=forms.select(choices=NO_OF_HRS),max_length=2)
When I try to run, I get the following error,
NO_OF_HRS is not defined