Any idea how to add __init__() to a form class, created by modelform_factory () 
?

Axel

Am 02.11.2015 um 13:50 schrieb Vijay Khemlani <[email protected]>:

> At least what I do in those cases is to add a constructor (__init__) to the 
> form class which takes the user as a parameter, modify the choicefield 
> queryset, and then call the original constructor of the form.
> 
> On Sun, Nov 1, 2015 at 3:50 PM, Axel Rau <[email protected]> wrote:
> User should see only choices related to him in a ModelChoiceField.
> Do I need a fresh form per request?
> What would be the best approach?
> 
> Thanks, Axel
> ---
> PGP-Key:29E99DD6  ☀ +49 160 9945 7889  ☀ computing @ chaos claudius
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/728C3EDF-62BB-4450-920B-BB7376417D9C%40Chaos1.DE.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALn3ei0v3POcwmw9s0beYyGXK15ybwDPooPsYDm%3D1_0XvpStpQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

---
PGP-Key:29E99DD6  ☀ +49 160 9945 7889  ☀ computing @ chaos claudius

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1B5822AC-4F06-4466-8DD0-4996BAC6ABF2%40Chaos1.DE.
For more options, visit https://groups.google.com/d/optout.

Reply via email to