On 24 nov, 02:06, Christophe Pettus <x...@thebuild.com> wrote:
> On Nov 23, 2010, at 2:25 AM, bruno desthuilliers wrote:
>
> > Strictly speaking, you don't need the queryset attribute of a
> > ModelChoiceField to be a QuerySet instance - as long as the object you
> > pass in has a '.all()' method that returns an iterable, you should be
> > fine (cf django/forms/models.py for the definition of the
> > ModelChoiceField class and the companion ModelChoiceIterator class).
>
> > Also, note that if you manually set the .choices property of your
> > ModelChoiceField, it will totally bypass access to the .queryset
> > attribute.
>
> Almost!  Almost!  So close, and yet so far...   It looks like 
> ModelChoiceField also uses the .get method of the queryset to do the 
> validation, and it does go straight to the queryset (bypassing the choices) 
> in that situation.

Duh... Sorry, I missed that part.

> Darn.  I might still be able to fake it...

Indeed.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to