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.
