#2445: [patch] allow callable values for limit_choices_to
-------------------------------------+--------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: Core framework
Version: | Resolution:
Keywords: | Stage: Design decision
needed
Has_patch: 1 | Needs_docs: 1
Needs_tests: 1 | Needs_better_patch: 0
-------------------------------------+--------------------------------------
Comment (by webograph <[EMAIL PROTECTED]>):
i think that callables should be passed a reference to self, at least if
they accept it -- think of the following model:
{{{
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')
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/2445#comment:8>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---