phantasmobile/app/page/models.py

17 lines
444 B
Python
Raw Normal View History

2023-07-25 19:03:54 +00:00
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