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