Re: filtering drop downs according to logged in user

2011-04-22 Thread vishy
test On Apr 21, 7:10 pm, "Szabo, Patrick \(LNG-VIE\)" wrote: > Hi, > > I want to filter the dropdownlists that are automatically used to select > a foreign-key in forms (in my views). > > Normally that could easily be done with "class Meta" in the Modelform. > >

Re: filtering drop downs according to logged in user

2011-04-22 Thread vishy
On Apr 21, 7:10 pm, "Szabo, Patrick \(LNG-VIE\)" wrote: > Hi, > > I want to filter the dropdownlists that are automatically used to select > a foreign-key in forms (in my views). > > Normally that could easily be done with "class Meta" in the Modelform. > > Thing is

AW: filtering drop downs according to logged in user

2011-04-22 Thread Szabo, Patrick (LNG-VIE)
-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Szabo, Patrick (LNG-VIE) Gesendet: Freitag, 22. April 2011 09:10 An: django-users@googlegroups.com Betreff: AW: filtering drop downs according to logged in user Hi, I like that idea. I have a problem with implementing

AW: filtering drop downs according to logged in user

2011-04-22 Thread Szabo, Patrick (LNG-VIE)
l.: +43 (1) 534 52 - 1573 Fax: +43 (1) 534 52 - 146 -Ursprüngliche Nachricht- Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Dan Gentry Gesendet: Donnerstag, 21. April 2011 21:05 An: Django users Betreff: Re: filtering drop downs according

AW: filtering drop downs according to logged in user

2011-04-22 Thread Szabo, Patrick (LNG-VIE)
ith Python ^^ Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Cal Leeming [Simplicity Media Ltd] Gesendet: Donnerstag, 21. April 2011 19:02 An: django-users@googlegroups.com Betreff: Re: filtering drop downs according to logged in user Completely off topic

Re: filtering drop downs according to logged in user

2011-04-21 Thread Dan Gentry
I have set the choices list in the view: choices = SomeModel.objects.filter(user=request.user).values_list('id','label') Then, after the form is instantiated, modify the choices attribute of the ChoiceField: form = SomeOtherModelForm() form.fields['model_dropdown'].choices = choices

Re: filtering drop downs according to logged in user

2011-04-21 Thread Cal Leeming [Simplicity Media Ltd]
Completely off topic but, what exactly does an "XSLT Developer" do? On Thu, Apr 21, 2011 at 3:10 PM, Szabo, Patrick (LNG-VIE) < patrick.sz...@lexisnexis.at> wrote: > Hi, > > > > I want to filter the dropdownlists that are automatically used to select a > foreign-key in forms (in my views). > >

Re: filtering drop downs according to logged in user

2011-04-21 Thread Oleg Lomaka
As an option, you can pass a request.user to form's __init__ method from your view. Example: class YourForm(forms.ModelForm): def __init__(self, user, *args, **kwargs): self.user = user super(YourForm, self).__init__(*args, **kwargs) # here you can modify any

filtering drop downs according to logged in user

2011-04-21 Thread Szabo, Patrick (LNG-VIE)
Hi, I want to filter the dropdownlists that are automatically used to select a foreign-key in forms (in my views). Normally that could easily be done with "class Meta" in the Modelform. Thing is i want to filter by an attribute of the current userspecificly the groups that the user is