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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user