2008-07-21 23:41:21 +08:00
|
|
|
from django.db import models
|
|
|
|
|
2011-10-14 05:34:56 +08:00
|
|
|
|
2008-07-21 23:41:21 +08:00
|
|
|
class SourceManager(models.Manager):
|
2013-03-08 22:15:23 +08:00
|
|
|
def get_queryset(self):
|
|
|
|
return super(SourceManager, self).get_queryset().filter(is_public=True)
|
2008-07-21 23:41:21 +08:00
|
|
|
|
2013-11-03 05:34:05 +08:00
|
|
|
|
2008-07-21 23:41:21 +08:00
|
|
|
class Source(models.Model):
|
2013-08-12 04:19:09 +08:00
|
|
|
is_public = models.BooleanField(default=False)
|
2008-07-21 23:41:21 +08:00
|
|
|
objects = SourceManager()
|
|
|
|
|
2013-11-03 05:34:05 +08:00
|
|
|
|
2008-07-21 23:41:21 +08:00
|
|
|
class Item(models.Model):
|
|
|
|
source = models.ForeignKey(Source)
|