File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 11""" 
22The manager class for the CMS models 
33""" 
4- import  django 
54from  mptt .managers  import  TreeManager 
65from  polymorphic  import  PolymorphicManager 
76from  polymorphic .query  import  PolymorphicQuerySet 
@@ -30,11 +29,6 @@ def toplevel(self):
3029 """ 
3130 Return all nodes which have no parent. 
3231 """ 
33-  if  hasattr (PolymorphicManager , 'get_queryset' ) and  django .VERSION  >=  (1 ,6 ):
34-  # Latest django-polymorphic for Django 1.7 
35-  # Should not be used for Django 1.4/1.5 all all, as that breaks the RelatedManager 
36-  qs  =  self .get_queryset ()
37-  else :
38-  qs  =  self .get_query_set ()
39- 
40-  return  qs .toplevel ()
32+  # By using .all(), the proper get_query_set()/get_queryset() will be used for each Django version. 
33+  # Django 1.4/1.5 need to use get_query_set(), because the RelatedManager overrides that. 
34+  return  qs .all ().toplevel ()
                         You can’t perform that action at this time. 
           
                  
0 commit comments