Form.factory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Form.factory

Jamesie Pic
Hello everybody,

Currently, we can set extra request/view arguments in a form by overriding a CBV get_form* method. This way, we can add things such as request.user, if we also override the Form constructor to accept such arguments.

I'd like to suggest that we add a factory(cls, view) method to the Form class, and make CBV call self.form_class.factory(view, *ctor_args, **ctor_kwargs) as a way to keep the view->form variables logic in a single place.

Thanks for your time
Best regards
<3

--

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAC6Op1_OFL6vOGH-PxXmx4zNkUxQMFhEN7Ded4e1zYhL50QEyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.