multiple authors implemented

This commit is contained in:
Anatoly Bubenkov 2013-07-05 01:08:45 +02:00
commit 2c25e488c4
16 changed files with 122 additions and 59 deletions

View file

@ -74,11 +74,17 @@ class Content(object):
#default template if it's not defined in page
self.template = self._get_template()
# default author to the one in settings if not defined
# First, read the authors from "authors", if not, fallback to "author"
# and if not use the settings defined one, if any.
if not hasattr(self, 'author'):
if 'AUTHOR' in settings:
if hasattr(self, 'authors'):
self.author = self.authors[0]
elif 'AUTHOR' in settings:
self.author = Author(settings['AUTHOR'], settings)
if not hasattr(self, 'authors') and hasattr(self, 'author'):
self.authors = [self.author]
# XXX Split all the following code into pieces, there is too much here.
# manage languages