Permalink
Browse files

page __unicode__ now returns get_menu_title instead of slug and also …

…adds a plus sign for every level. This should make linking to pages more userfriendly.
  • Loading branch information...
digi604 committed Nov 23, 2009
1 parent 173996e commit 5b78f5d1bce45cb102ddae39e2a000c67aa37de1
Showing with 8 additions and 5 deletions.
  1. +8 −5 cms/models/pagemodel.py
View
@@ -75,11 +75,14 @@ class PublisherMeta:
exclude_fields_append = ['moderator_state']
def __unicode__(self):
- slug = self.get_slug(fallback=True)
- if slug is None:
- return u'' # otherwise we get unicode decode errors
- else:
- return slug
+ title = self.get_menu_title(fallback=True)
+ if title is None:
+ title = ""
+
+ for i in xrange(self.level):
+ title = "+" + title
+
+ return title
def move_page(self, target, position='first-child'):

0 comments on commit 5b78f5d

Please sign in to comment.