2011-12-27 13:05:42 +00:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
class Page(models.Model):
|
|
|
|
title = models.CharField(max_length=255)
|
|
|
|
slug = models.SlugField(max_length=64)
|
|
|
|
main_image = models.ImageField(upload_to='upload/images/pages/', blank=True, null=True)
|
|
|
|
text = models.TextField(blank=True)
|
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return self.title
|
|
|
|
|
2011-12-30 13:24:28 +00:00
|
|
|
def get_absolute_url(self):
|
|
|
|
return "/page/%s/" % self.slug
|
|
|
|
|
2011-12-27 13:05:42 +00:00
|
|
|
# Create your models here.
|