django-model-utils/model_utils/tests/models.py
Carl Meyer 7703512c7f 0.3.0
--HG--
extra : convert_revision : carl%40dirtcircle.com-20090730211136-ywu7dfqfmsodkc1x
2009-07-30 17:11:36 -04:00

28 lines
743 B
Python

from django.db import models
from model_utils.models import InheritanceCastModel, TimeStampedModel
from model_utils.managers import QueryManager
class InheritParent(InheritanceCastModel):
pass
class InheritChild(InheritParent):
pass
class TimeStamp(TimeStampedModel):
pass
class Post(models.Model):
published = models.BooleanField()
confirmed = models.BooleanField()
order = models.IntegerField()
objects = models.Manager()
public = QueryManager(published=True)
public_confirmed = QueryManager(models.Q(published=True) &
models.Q(confirmed=True))
public_reversed = QueryManager(published=True).order_by('-order')
class Meta:
ordering = ('order',)