예제 #1
0
 def get_queryset(self, *args, **kwargs):
     """
     Ensures that this manager always returns nodes in tree order.
     """
     if django.VERSION < (1, 7):
         qs = TreeQuerySet(self.model, using=self._db)
     else:
         qs = super(TreeManager, self).get_queryset(*args, **kwargs)
     return qs.order_by(self.tree_id_attr, self.left_attr)
예제 #2
0
    def get_query_set(self, *args, **kwargs):
        """
        Ensures that this manager always returns nodes in tree order.

        This method can be removed when support for Django < 1.6 is dropped.
        """
        return TreeQuerySet(self.model, using=self._db).order_by(self.tree_id_attr, self.left_attr)
예제 #3
0
 def get_queryset(self, *args, **kwargs):
     """
     Ensures that this manager always returns nodes in tree order.
     """
     return TreeQuerySet(self.model,
                         using=self._db).order_by(self.tree_id_attr,
                                                  self.left_attr)