Small tweaks to TreeModel.get_path to take advantage of updates to django-mptt. Updat...
authorStephen Burrows <stephen.r.burrows@gmail.com>
Tue, 4 Jan 2011 18:16:57 +0000 (13:16 -0500)
committerStephen Burrows <stephen.r.burrows@gmail.com>
Fri, 21 Jan 2011 22:21:30 +0000 (17:21 -0500)
README
README.markdown
models/base.py

diff --git a/README b/README
index 5ce7b93..4b1a6f7 100644 (file)
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ Philo is a foundation for developing web content management systems.
 Prerequisites:
        * Python 2.5.4+ <http://www.python.org/>
        * Django 1.2+ <http://www.djangoproject.com/>
-       * django-mptt 0.4+ <https://github.com/django-mptt/django-mptt/> 
+       * django-mptt e734079+ <https://github.com/django-mptt/django-mptt/> 
        * (Optional) django-grappelli 2.0+ <http://code.google.com/p/django-grappelli/>
        * (Optional) recaptcha-django r6 <http://code.google.com/p/recaptcha-django/>
        * (Optional) south 0.7.2+ <http://south.aeracode.org/>
@@ -20,4 +20,4 @@ After installing philo and mptt on your python path, make sure to complete the f
 3. include 'philo.urls' somewhere in your urls.py file.
 4. Optionally add a root node to your current Site.
 
-Philo should be ready to go!
\ No newline at end of file
+Philo should be ready to go!
index 0e695c5..8060db8 100644 (file)
@@ -4,7 +4,7 @@ Prerequisites:
 
  * [Python 2.5.4+ &lt;http://www.python.org&gt;](http://www.python.org/)
  * [Django 1.2+ &lt;http://www.djangoproject.com/&gt;](http://www.djangoproject.com/)
- * [django-mptt 0.4+ &lt;https://github.com/django-mptt/django-mptt/&gt;](https://github.com/django-mptt/django-mptt/)
+ * [django-mptt e734079+ &lt;https://github.com/django-mptt/django-mptt/&gt;](https://github.com/django-mptt/django-mptt/)
  * (Optional) [django-grappelli 2.0+ &lt;http://code.google.com/p/django-grappelli/&gt;](http://code.google.com/p/django-grappelli/)
  * (Optional) [south 0.7.2+ &lt;http://south.aeracode.org/)](http://south.aeracode.org/)
  * (Optional) [recaptcha-django r6 &lt;http://code.google.com/p/recaptcha-django/&gt;](http://code.google.com/p/recaptcha-django/)
@@ -21,4 +21,4 @@ After installing philo and mptt on your python path, make sure to complete the f
 3. include 'philo.urls' somewhere in your urls.py file.
 4. Optionally add a root node to your current Site.
 
-Philo should be ready to go!
\ No newline at end of file
+Philo should be ready to go!
index 3bcf394..290e8b8 100644 (file)
@@ -425,12 +425,12 @@ class TreeModel(MPTTModel):
                if root is not None and not self.is_descendant_of(root):
                        raise AncestorDoesNotExist(root)
                
-               qs = self.get_ancestors()
+               qs = self.get_ancestors(include_self=True)
                
                if root is not None:
                        qs = qs.filter(**{'%s__gt' % self._mptt_meta.level_attr: root.get_level()})
                
-               return pathsep.join([getattr(parent, field, '?') for parent in list(qs) + [self]])
+               return pathsep.join([getattr(parent, field, '?') for parent in qs])
        path = property(get_path)
        
        def __unicode__(self):