Add a DEFAULT_METADATA setting.

It is now possible to have soem default metadata defined in the settings. Fixes #98
This commit is contained in:
Alexis Metaireau 2011-05-07 19:56:55 +01:00
commit 56effc24cb
5 changed files with 11 additions and 1 deletions

View file

@ -16,7 +16,10 @@ class Page(object):
self.translations = []
self.status = "published" # default value
for key, value in metadatas.items():
local_metadata = dict(settings['DEFAULT_METADATA'])
local_metadata.update(metadatas)
for key, value in local_metadata.items():
setattr(self, key.lower(), value)
if not hasattr(self, 'author'):

View file

@ -37,6 +37,7 @@ _DEFAULT_CONFIG = {'PATH': None,
'WITH_PAGINATION': False,
'DEFAULT_PAGINATION': 5,
'DEFAULT_ORPHANS': 0,
'DEFAULT_METADATA': (),
}
def read_settings(filename):