1
0
Fork 0
forked from github/pelican

Add a new signal content_object_init

It's sent when a new content object is created: Page, Article
This commit is contained in:
Rachid Belaid 2012-09-02 19:20:42 +01:00
commit 6100773c24
3 changed files with 31 additions and 7 deletions

View file

@ -11,7 +11,7 @@ from sys import platform, stdin
from pelican.settings import _DEFAULT_CONFIG
from pelican.utils import slugify, truncate_html_words
from pelican import signals
logger = logging.getLogger(__name__)
@ -106,6 +106,8 @@ class Page(object):
if 'summary' in metadata:
self._summary = metadata['summary']
signals.content_object_init.send(self.__class__, instance=self)
def check_properties(self):
"""test that each mandatory property is set."""
for prop in self.mandatory_properties: