mirror of
https://github.com/django/django.git
synced 2025-08-31 15:57:45 +00:00
Fixed bugs in docs/model-api.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2881 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
3248a28b20
commit
887131c749
1 changed files with 3 additions and 3 deletions
|
@ -1413,7 +1413,7 @@ all objects, and one that returns only the books by Roald Dahl::
|
|||
# First, define the Manager subclass.
|
||||
class DahlBookManager(models.Manager):
|
||||
def get_query_set(self):
|
||||
return super(Manager, self).get_query_set().filter(author='Roald Dahl')
|
||||
return super(DahlBookManager, self).get_query_set().filter(author='Roald Dahl')
|
||||
|
||||
# Then hook it into the Book model explicitly.
|
||||
class Book(models.Model):
|
||||
|
@ -1444,11 +1444,11 @@ For example::
|
|||
|
||||
class MaleManager(models.Manager):
|
||||
def get_query_set(self):
|
||||
return super(Manager, self).get_query_set().filter(sex='M')
|
||||
return super(MaleManager, self).get_query_set().filter(sex='M')
|
||||
|
||||
class FemaleManager(models.Manager):
|
||||
def get_query_set(self):
|
||||
return super(Manager, self).get_query_set().filter(sex='F')
|
||||
return super(FemaleManager, self).get_query_set().filter(sex='F')
|
||||
|
||||
class Person(models.Model):
|
||||
first_name = models.CharField(maxlength=50)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue