On 11/13/07, Ken <[EMAIL PROTECTED]> wrote:
>
> I'm using 0.96. I define the following form
>
> class TForm(forms.Form):
> admin = forms.ChoiceField()
> x = forms.IntegerField()
>
> def __init__(self, data=None, **kwargs):
> super(TForm, self).__init__(data, kwargs)
> admins = [(a.name, a.name) for a in Admin.objects.all()]
> self.fields['admin']._set_choices(admins)
I think you want:
Super(TForm, self).__init__(data, **kwargs)
(Note the ** in front of kwrags)
You're passing a dict as a second positional argument here instead of
expanding that dict to keyword arguments.
Joseph
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---