#6044: limit_choices_to in one class disable edit_inline of a second in a third
class
-----------------------+----------------------------------------------------
Reporter: anonymous | Owner: nobody
Status: new | Component: Admin interface
Version: SVN | Keywords: limit_choices_to,edit_inline
Stage: Unreviewed | Has_patch: 0
-----------------------+----------------------------------------------------
I have 4 classes: A,B, AImage and BImge. All inherit from models.Model
In AImage I have
{{{
item = models.ForeignKey(A, edit_inline=models.TABULAR, num_in_admin=6)
}}}
and in BImage
{{{
item = models.ForeignKey(B, edit_inline=models.TABULAR, num_in_admin=6)
}}}
Now I add to B
{{{
def adder():
cats = A.objects.all()
portfolio = A.objects.get(slug='something')
CATS={}
for c in cats:
if (portfolio in c.get_p_list()) or (c == portfolio):
CATS[c.title]=c
return CATS
a_item = models.ForeignKey(a, limit_choices_to =
{'title__in':adder()})
}}}
The result: AImage won't appear in A's admin screen. If limit_choices_to
is not used in B, A will be shown correctly
--
Ticket URL: <http://code.djangoproject.com/ticket/6044>
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
-~----------~----~----~----~------~----~------~--~---