2 from django.utils.translation import ugettext as _
5 friendly_name = _("page")
13 return self._as_markdown(self.body)
15 def save(self, *args, **kwargs):
16 old_options = self._original_state.get('extra', None)
18 super(Page, self).save(*args, **kwargs)
20 registry = settings.STATIC_PAGE_REGISTRY
23 registry.pop(old_options.get('path', ''), None)
25 registry[self.extra['path']] = self.id
28 settings.STATIC_PAGE_REGISTRY.set_value(registry)
35 return _("[Unpublished] %s") % self.title
38 def get_absolute_url(self):
39 return ('static_page', (), {'path': self.extra['path']})
41 def activate_revision(self, user, revision, extensions=['urlize']):
42 self.title = revision.title
43 self.tagnames = revision.tagnames
44 self.body = revision.body
46 self.active_revision = revision
47 self.update_last_activity(user)
51 class Meta(Node.Meta):