1. Alessandro Molina
  2. tgapp-smallpress

Commits

Alessandro Molina  committed 896db12

Add an hook at save time to make possible to change article values

  • Participants
  • Parent commits be7d591
  • Branches default

Comments (0)

Files changed (1)

File smallpress/controllers/root.py

View file
  • Ignore whitespace
     @expose()
     def save(self, *args, **kw):
         article = DBSession.query(Article).get(kw['uid'])
+
+        hooks = config['hooks'].get('smallpress.before_save_article', [])
+        for func in hooks:
+            func(article, kw)
+
         article.title = kw['title']
         article.description = kw['description']
         article.content = kw['content']