Merge pull request #299 from merwok-forks/patch-1
Fix docs about creating manager with custom querysetfix_request_path_info
commit
88d59d985b
|
|
@ -65,7 +65,6 @@ ArtProject inherited the managers ``objects`` and ``objects_ordered`` from Proje
|
||||||
``ArtProject.objects_ordered.all()`` will return all art projects ordered
|
``ArtProject.objects_ordered.all()`` will return all art projects ordered
|
||||||
regarding their start time and ``ArtProject.objects_ordered.most_recent()``
|
regarding their start time and ``ArtProject.objects_ordered.most_recent()``
|
||||||
will return the ten most recent art projects.
|
will return the ten most recent art projects.
|
||||||
.
|
|
||||||
|
|
||||||
Using a Custom Queryset Class
|
Using a Custom Queryset Class
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
@ -80,9 +79,9 @@ instead of Django's QuerySet as the base class::
|
||||||
from polymorphic.query import PolymorphicQuerySet
|
from polymorphic.query import PolymorphicQuerySet
|
||||||
|
|
||||||
class MyQuerySet(PolymorphicQuerySet):
|
class MyQuerySet(PolymorphicQuerySet):
|
||||||
def my_queryset_method(...):
|
def my_queryset_method(self):
|
||||||
...
|
...
|
||||||
|
|
||||||
class MyModel(PolymorphicModel):
|
class MyModel(PolymorphicModel):
|
||||||
my_objects=PolymorphicManager(MyQuerySet)
|
my_objects = PolymorphicManager.from_queryset(MyQuerySet)
|
||||||
...
|
...
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue