Sorry, first post had an error.
class CancelForm(forms.Form):
name = forms.CharField(label="name", max_length=10)
no = forms.CharField(label="personalid", max_length=10)
unit = forms.ChoiceField(label="unitname", choices=[])
def __init__(self,*args,**kwargs):
super(CancelForm, self).__init__(*args, **kwargs)
self.fields['unit'].widget.choices = [('', '------------')] +
[(unit.id, unit.name) for unit in Sign2.objects.all()]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---