models.py 565 Bytes
# -*- coding: utf-8 -*-

from django.db.models import Model, CharField, TextField, Manager
from django.utils.translation import ugettext_lazy as _


class FlatPage(Model):
    text_id = CharField(max_length=20, verbose_name=_(u'id'))
    title = CharField(max_length=160, verbose_name=_(u'title'))
    html_content = TextField(verbose_name=_(u'HTML content'), blank=True)


class NotDeletedManager(Manager):
    use_for_related_field = True

    def get_queryset(self):
        return super(NotDeletedManager, self).get_queryset().filter(
            deleted=False)