2009-05-17 11:34:55 +00:00
|
|
|
from django.db import models
|
2018-07-24 15:25:07 +00:00
|
|
|
from django.urls import reverse
|
2009-05-17 11:34:55 +00:00
|
|
|
from transmeta import TransMeta
|
|
|
|
|
|
|
|
class Page(models.Model):
|
|
|
|
__metaclass__ = TransMeta
|
|
|
|
|
|
|
|
slug = models.SlugField(unique=True, primary_key=True)
|
2014-10-04 09:22:47 +00:00
|
|
|
title = models.CharField(u"Title", max_length=256)
|
|
|
|
body = models.TextField(u"Body")
|
2009-05-17 11:34:55 +00:00
|
|
|
public = models.BooleanField(default=True)
|
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return u"Page[%s]" % self.slug
|
|
|
|
|
2020-02-12 19:12:14 +00:00
|
|
|
__str__ = __unicode__
|
|
|
|
|
2009-05-17 11:34:55 +00:00
|
|
|
def get_absolute_url(self):
|
2014-10-04 09:22:47 +00:00
|
|
|
return reverse('questionnaire.page.views.page', kwargs={'page_to_render':self.slug})
|
2009-05-17 11:34:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
translate = ('title','body',)
|