|
@@ -1155,11 +1155,19 @@ query you can use the following syntax::
|
|
|
|
|
|
class Entry(models.Model):
|
|
|
#...
|
|
|
- objects = models.Manager() # Default Manager
|
|
|
- entries = EntryManager() # Custom Manager
|
|
|
+ objects = models.Manager() # Default Manager
|
|
|
+ entries = EntryManager() # Custom Manager
|
|
|
|
|
|
- >>> b = Blog.objects.get(id=1)
|
|
|
- >>> b.entry_set(manager='entries').all()
|
|
|
+ b = Blog.objects.get(id=1)
|
|
|
+ b.entry_set(manager='entries').all()
|
|
|
+
|
|
|
+If ``EntryManager`` performed default filtering in its ``get_queryset()``
|
|
|
+method, that filtering would apply to the ``all()`` call.
|
|
|
+
|
|
|
+Of course, specifying a custom reverse manager also enables you to call its
|
|
|
+custom methods::
|
|
|
+
|
|
|
+ b.entry_set(manager='entries').is_published()
|
|
|
|
|
|
Additional methods to handle related objects
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|