On Aug 19, 10:24 pm, Robert <[EMAIL PROTECTED]> wrote:
> Great! that works perfectly. However, it seems to have opened up
> pandora's box of problems that I'm not able to solve. I've pinpointed
> the problem now, and I'll summarize it below as follows, although
> perhaps it deserves a new thread.
>
> I have a custom form class that's called from a separate view file.
> That form class has an init method, and it works perfectly when I
> don't have to pass any parameters to that method. However, when I pass
> in ANY parameter (so it's not a namespace issue) the form simply won't
> submit. It'll load perfectly, but when I push 'submit', it just
> reloads a new version of itself.
> Do I need to change any of the code in the view method (other than
> obviously passing the parameter in to the form) to reflect the
> parameter change?
> Thanks so much!
> -Robert

You'll need to show some code to help debug this properly, but at a
guess I'd say that you're not preserving the default args/kwargs
properly in your overridden init, and/or not passing them properly to
super().

You should be doing something like this:

class MyForm(forms.Form):
    def __init__(self, custom_param, *args, **kwargs):
        do_something_with_custom_param
        super(MyForm, self).__init__(*args, **kwargs)

or if your custom param needs to be a keyword argument,
    def __init__(self, *args, **kwargs):
        custom_param = kwargs.pop('custom_param')
        etc...

--
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