El Tue, 06 Nov 2007 10:28:39 -0800
Chris Brand <[EMAIL PROTECTED]> escribió:

> 
> Gonzalo Delgado wrote:
> >
> >  The question is: why doesn't something like this work:
> >
> >     ticketform.fields['server'].queryset = 
> > Server.objects.filter(users=request.user)
> > ?
> >  It doesn't end up on any error, but the rendered form doesn't filter out 
> > the server choices.. any clue?
> >
> >   
> Sounds like you're hitting bug 4787 
> (http://code.djangoproject.com/ticket/4787), where the change in 
> queryset on the field doesn't get propagated to the widget. You can work 
> around by assigning to the widget's choices directly :
> ticketform.fields['server'].widget.choices = 
> ticketform.fields['server'].choices
> (after changing the field's choices, obviously)
> 
> Chris
> 

 Smelled like a bug.. thanks Chris! :)

-- 
Gonzalo Delgado <[EMAIL PROTECTED]>

Attachment: pgpfN5WqhEDGa.pgp
Description: PGP signature

Reply via email to