#7700: Query parent for child
------------------------------+---------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 0 |
------------------------------+---------------------------------------------
I'm not sure if this is a feature request or a bug fix :) This seemed to
work a few weeks ago, and it no longer does. Whether or not the feature
was intentional, it was quite useful--being able to query parent models
for child instances. Given the following model:
{{{
from django.contrib.auth.models import Group
class Team(Group):
pass
}}}
I want to query the Groups to find out which are Teams. This used to work
{{{
>>> g = Group.objects.create(name='group1')
>>> t = Team.objects.create(name='team1')
>>> Group.objects.filter(team__pk__isnull=False)
[<Group: team1>]
}}}
But instead now I get the following:
{{{
>>> Group.objects.filter(team__pk__isnull=False)
[<Group: group1>, <Group: team1>]
}}}
Ideally, it would be nice to simplify this to:
{{{
>>> Group.objects.filter(team__isnull=False)
[<Group: team1>]
}}}
But just getting it to work again would be nice.
--
Ticket URL: <http://code.djangoproject.com/ticket/7700>
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
-~----------~----~----~----~------~----~------~--~---