form = NewsForm(request.POST, somegroup=somegroup)
given your form __init__ definition, you are passing POST into the
spot for somegroup.
What I did to get around this was something like this:
class NewsBaseForm(BaseForm):
def __init__(self, *args, **kwargs):
nkwargs = kwargs.copy()
if nkwargs.has_key('somegroup'):
somegroup=kwargs.pop('somegroup')
else:
somegroup=None
super(NewsBaseForm, self).__init__(*args, **nkwargs)
self.fields['place'].choices = [(p.id, p.name) for p in
Place.objects.filter(display_for__pk=somegroup)]
There may be easier ways
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---