Permalink
Browse files

edited __unicode__ to be more pythonic and removed hardcoded string

Conflicts:

	cms/models/pagemodel.py
  • Loading branch information...
digi604 committed Dec 1, 2009
1 parent e284b6e commit d20e4fb808ff0979cd0d4dca1d058fccadaf2a5c
Showing with 7 additions and 8 deletions.
  1. +4 −1 cms/conf/global_settings.py
  2. +3 −7 cms/models/pagemodel.py
@@ -95,4 +95,7 @@
# moderator mode - if True, approve path can be setup for every page, so there
# will be some control over the published stuff
-CMS_MODERATOR = False
+CMS_MODERATOR = False
+
+# Defines what character will be used for the __unicode__ handling of cms pages
+CMS_TITLE_CHARACTER = '+'
View
@@ -77,13 +77,9 @@ class PublisherMeta:
def __unicode__(self):
title = self.get_menu_title(fallback=True)
if title is None:
- title = ""
-
- for i in xrange(self.level):
- title = "+" + title
-
- return title
-
+ title = u""
+ pre_title = settings.CMS_TITLE_CHARACTER * self.level
+ return u'%s%s' % (pre_title, title)
def move_page(self, target, position='first-child'):
"""Called from admin interface when page is moved. Should be used on

0 comments on commit d20e4fb

Please sign in to comment.