Uses mptt.managers.TreeManager as a base manager. #1492

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+9 −10
Split
View
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-from django.db import models
+from mptt import managers
from cms.publisher.query import PublisherQuerySet
-class PublisherManager(models.Manager):
+
+class PublisherManager(managers.TreeManager):
"""Manager with some support handling publisher.
"""
def get_query_set(self):
@@ -15,11 +16,9 @@ def drafts(self):
def public(self):
return self.filter(publisher_is_draft=False)
-
- """
- def all(self):
- raise NotImplementedError, ("Calling all() on manager of publisher "
- "object is not allowed. Please use drafts() or public() method "
- "instead. If this isn't accident use get_query_set().all() for "
- "all instances.")
- """
+
+# def all(self):
+# raise NotImplementedError, ("Calling all() on manager of publisher "
+# "object is not allowed. Please use drafts() or public() method "
+# "instead. If this isn't accident use get_query_set().all() for "
+# "all instances.")
@ojii

ojii Oct 26, 2012

Collaborator

why comment those lines out instead of removing them? And why remove them in the first place?

@BertrandBordage

BertrandBordage Nov 12, 2012

Contributor

I commented this because it is the right way to... comment. This was "stringed" for a reason I ignore. And since I think it is OK to perform a .all() on a PublisherManager (to be able to do Page.objects.all() for example), removing them may be the best thing to do. I will update this pull request if you agree.