kopia lustrzana https://github.com/wagtail/wagtail
Make PageQuerySet inherit from treebeards MP_NodeQuerySet
rodzic
b48d0c6fa2
commit
0cbe15b741
|
@ -1,9 +1,18 @@
|
|||
from django.db.models.query import QuerySet
|
||||
from django.db.models import Q
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
|
||||
class PageQuerySet(QuerySet):
|
||||
# hack to import our patched copy of treebeard at wagtail/vendor/django-treebeard -
|
||||
# based on http://stackoverflow.com/questions/17211078/how-to-temporarily-modify-sys-path-in-python
|
||||
import sys
|
||||
import os
|
||||
treebeard_path = os.path.join(os.path.dirname(__file__), '..', 'vendor', 'django-treebeard')
|
||||
sys.path.insert(0, treebeard_path)
|
||||
from treebeard.mp_tree import MP_NodeQuerySet
|
||||
sys.path.pop(0)
|
||||
|
||||
|
||||
class PageQuerySet(MP_NodeQuerySet):
|
||||
"""
|
||||
Defines some extra query set methods that are useful for pages.
|
||||
"""
|
||||
|
|
Ładowanie…
Reference in New Issue