1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #16048 -- Use the base manager instead of the default manager to retrieve a related object of a GenericForeignKey similar to ForeignKeys. Thanks, adurdin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-05-22 15:21:03 +00:00
parent fc8116cc4f
commit d95355b6db
3 changed files with 15 additions and 2 deletions

View File

@@ -78,3 +78,11 @@ class Mineral(models.Model):
def __unicode__(self):
return self.name
class GeckoManager(models.Manager):
def get_query_set(self):
return super(GeckoManager, self).get_query_set().filter(has_tail=True)
class Gecko(models.Model):
has_tail = models.BooleanField()
objects = GeckoManager()