- return dict(settings.TYPES_DICT)[self.type]
-
-
-add_translatable(Entry, languages=settings.OBLIGATORY_LANGUAGES, fields={
- 'slug': models.SlugField(unique=True, db_index=True),
- 'title': models.CharField(_('title'), max_length=255),
- 'lead': MarkupField(_('lead'), markup_type='textile_pl'),
-})
-
-add_translatable(Entry, languages=settings.OPTIONAL_LANGUAGES, fields={
- 'slug': models.SlugField(unique=True, db_index=True, null=True, blank=True),
- 'title': models.CharField(_('title'), max_length=255, null=True, blank=True),
- 'lead': MarkupField(_('lead'), markup_type='textile_pl', null=True, blank=True),
+ return dict(app_settings.TYPES_DICT)[self.type]
+
+ def notify_author_published(self):
+ if not self.author_email:
+ return
+ site = Site.objects.get_current()
+ mail_text = loader.get_template('migdal/mail/published.txt').render(
+ Context({
+ 'entry': self,
+ 'site': site,
+ }))
+ send_mail(
+ ugettext(u'Your story has been published at %s.') % site.domain,
+ mail_text, settings.SERVER_EMAIL, [self.author_email]
+ )
+
+
+
+
+add_translatable(Entry, languages=app_settings.OPTIONAL_LANGUAGES, fields={