See patch on ticket <http://code.djangoproject.com/ticket/2445>.

On Jan 29, 8:31 am, "qhfgva" <[EMAIL PROTECTED]> wrote:
> If my original post was not entirely clear, I'm interested in any
> method available to limit_choices_to that lets you dynamically create
> the list of available options as a function of the current model
> instance.
>
> thanks.
>
> On Jan 28, 4:28 pm, "qhfgva" <[EMAIL PROTECTED]> wrote:
>
> > I currently have a drop down for a model where I'd only like to show
> > choices that are currently "active".  That's easy enough with:
>
> >     foo          = models.ForeignKey(Foo,
> > limit_choices_to={'active__exact':True})
>
> > But if someone is working with a model where the "foo" that they had
> > previously selected has been subsequently set to inactive they should
> > be able to keep that foo (they are "grandfathered" in).
>
> > In effect I'd like limit_choices_to to have a list of foo.active ==
> > True plus the current selection they have from the past if it is not
> > an active choice.
>
> > If I could make a method of Foo such as Foo.allowed_choice_for_x  and
> > then pass it an instance of the current object, then it seems like I
> > could easily generate the specific drop downlist on the fly but I'm
> > not sure how to do that (or if it's possible).
>
> > Thoughts?


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

Reply via email to