On Aug 31, 11:58 am, Mike Ramirez <[email protected]> wrote:
> On Monday 31 August 2009 02:46:27 am Daniel Roseman wrote:
>
> > I think you're going to need to post your view code as well. It seems
> > that the form is passing itself, rather than its data, to the widget,
> > so I'd guess there's something weird about the way it's being
> > instantiated.
> > --
> > DR.
>
> Hereyou go, nothing special.
>
> http://dpaste.com/87647/
>
> Mike

OK I think the problem is that you've declared the form's __init__ to
take an extra argument, userip. So after a POST, in line 6, you're
correctly instantiating your form with the extra arg. However, on a
GET, in line 26, you don't pass in any arguments at all, so the
arguments are all shifted leftwards - what should be in data ends up
in userip, etc.

Either make sure you always pass in userip when you instantiate the
form, or (preferably) change the __init__ so that userip is in the
kwargs dictionary, and use kwargs.pop('userip') to get its value
before you hand off to super().
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to