it/itf/pages/models.py
2011-12-30 18:54:28 +05:30

16 lines
430 B
Python

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
def get_absolute_url(self):
return "/page/%s/" % self.slug
# Create your models here.