PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/tests/regressiontests/admin_filterspecs/models.py

https://code.google.com/p/mango-py/
Python | 23 lines | 20 code | 3 blank | 0 comment | 0 complexity | 75cfe88accc9ca22155e3c145732913c MD5 | raw file
 1from django.db import models
 2from django.contrib.auth.models import User
 3
 4class Book(models.Model):
 5    title = models.CharField(max_length=25)
 6    year = models.PositiveIntegerField(null=True, blank=True)
 7    author = models.ForeignKey(User, related_name='books_authored', blank=True, null=True)
 8    contributors = models.ManyToManyField(User, related_name='books_contributed', blank=True, null=True)
 9
10    def __unicode__(self):
11        return self.title
12
13class BoolTest(models.Model):
14    NO = False
15    YES = True
16    YES_NO_CHOICES = (
17        (NO, 'no'),
18        (YES, 'yes')
19    )
20    completed = models.BooleanField(
21        default=NO,
22        choices=YES_NO_CHOICES
23    )