Also discussed here: http://groups.google.com/group/django-users/browse_thread/thread/51228899c5a9a6c/d49271983401e29e
"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. " On Mon, Oct 27, 2008 at 1:16 PM, Alex Rades <[EMAIL PROTECTED]> wrote: > Hi, > is there currently a way to have something like: > > class Mother(models.Model): > firstborn = models.ForeignKey('Child', > limit_choices_to={'mother':lambda me: me}) > > class Child(models.Model): > mother = models.ForeignKey('Mother', related_name='children') > > (taken from http://code.djangoproject.com/ticket/2445 ) > > Basically I'd like to have access to the current instance of the > class, when working with limit_choices_to. Of course we can't use self > (we're still defining the class). > > Thank you! > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---