PageRenderTime 21ms CodeModel.GetById 9ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/regressiontests/reverse_single_related/models.py

https://code.google.com/p/mango-py/
Python | 12 lines | 9 code | 3 blank | 0 comment | 0 complexity | 4ac92fa79882a8cfd3ae5b66292b31c4 MD5 | raw file
 1from django.db import models
 2
 3class SourceManager(models.Manager):
 4    def get_query_set(self):
 5        return super(SourceManager, self).get_query_set().filter(is_public=True)
 6
 7class Source(models.Model):
 8    is_public = models.BooleanField()
 9    objects = SourceManager()
10
11class Item(models.Model):
12    source = models.ForeignKey(Source)