Skip to content

Commit

Permalink
edited __unicode__ to be more pythonic and removed hardcoded string
Browse files Browse the repository at this point in the history
Conflicts:

	cms/models/pagemodel.py
  • Loading branch information
Patrick Lauber committed Dec 1, 2009
1 parent e284b6e commit d20e4fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 4 additions & 1 deletion cms/conf/global_settings.py
Expand Up @@ -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 = '+'
10 changes: 3 additions & 7 deletions cms/models/pagemodel.py
Expand Up @@ -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
Expand Down

0 comments on commit d20e4fb

Please sign in to comment.