diff options
| author | Loic Bistuer <loic.bistuer@sixmedia.com> | 2013-03-08 09:15:23 -0500 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2013-03-08 10:11:45 -0500 |
| commit | 6983a1a540a6e6c3bd941fa15ddd8cb49f9ec74e (patch) | |
| tree | e57559ebfd704705458e6e218dc1f3d868b2922c /tests/custom_managers | |
| parent | 477d737e1e6bdf93950c8a381906925c594fac2f (diff) | |
Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that return a QuerySet.
Diffstat (limited to 'tests/custom_managers')
| -rw-r--r-- | tests/custom_managers/models.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/custom_managers/models.py b/tests/custom_managers/models.py index de7c1772ed..2f5e62fc7a 100644 --- a/tests/custom_managers/models.py +++ b/tests/custom_managers/models.py @@ -30,11 +30,11 @@ class Person(models.Model): def __str__(self): return "%s %s" % (self.first_name, self.last_name) -# An example of a custom manager that sets get_query_set(). +# An example of a custom manager that sets get_queryset(). class PublishedBookManager(models.Manager): - def get_query_set(self): - return super(PublishedBookManager, self).get_query_set().filter(is_published=True) + def get_queryset(self): + return super(PublishedBookManager, self).get_queryset().filter(is_published=True) @python_2_unicode_compatible class Book(models.Model): @@ -50,8 +50,8 @@ class Book(models.Model): # An example of providing multiple custom managers. class FastCarManager(models.Manager): - def get_query_set(self): - return super(FastCarManager, self).get_query_set().filter(top_speed__gt=150) + def get_queryset(self): + return super(FastCarManager, self).get_queryset().filter(top_speed__gt=150) @python_2_unicode_compatible class Car(models.Model): |
