16 lines
444 B
Python
16 lines
444 B
Python
from django.db import models
|
|
|
|
|
|
class Page(models.Model):
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
modified = models.DateTimeField(auto_now=True)
|
|
slug = models.CharField('Slug', max_length=255, unique=True)
|
|
|
|
title = models.CharField(max_length=1024)
|
|
content = models.TextField(default='', blank=True)
|
|
|
|
def __str__(self):
|
|
return self.slug
|
|
|
|
def get_absolute_url(self):
|
|
return '/%s' % self.slug
|