Mercurial > public > madeira
comparison band/models.py @ 162:27b38cc65ca4
Set defaults for BooleanFields.
THis suppresses a warning in Django 1.7 since the default changed in Django
1.6.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 02 Apr 2015 19:03:46 -0500 |
parents | e2868ad47a1e |
children |
comparison
equal
deleted
inserted
replaced
161:e73a108189fe | 162:27b38cc65ca4 |
---|---|
13 instrument = models.CharField(max_length=255) | 13 instrument = models.CharField(max_length=255) |
14 bio = models.TextField(blank=True) | 14 bio = models.TextField(blank=True) |
15 photo = models.ImageField(upload_to='images/bio/', blank=True) | 15 photo = models.ImageField(upload_to='images/bio/', blank=True) |
16 order = models.SmallIntegerField( | 16 order = models.SmallIntegerField( |
17 help_text = "Controls order of display; lower numbers displayed first") | 17 help_text = "Controls order of display; lower numbers displayed first") |
18 is_active = models.BooleanField() | 18 is_active = models.BooleanField(default=True) |
19 start_date = models.DateField() | 19 start_date = models.DateField() |
20 end_date = models.DateField(blank=True, | 20 end_date = models.DateField(blank=True, |
21 null=True, | 21 null=True, |
22 help_text="Only used if the member is not active") | 22 help_text="Only used if the member is not active") |
23 email = models.EmailField() | 23 email = models.EmailField() |
99 | 99 |
100 class Merchandise(models.Model): | 100 class Merchandise(models.Model): |
101 name = models.CharField(max_length=64) | 101 name = models.CharField(max_length=64) |
102 desc = models.TextField() | 102 desc = models.TextField() |
103 price = models.DecimalField(max_digits=5, decimal_places=2) | 103 price = models.DecimalField(max_digits=5, decimal_places=2) |
104 in_stock = models.BooleanField() | 104 in_stock = models.BooleanField(default=True) |
105 photo = models.ForeignKey(Photo) | 105 photo = models.ForeignKey(Photo) |
106 | 106 |
107 def __unicode__(self): | 107 def __unicode__(self): |
108 return self.name | 108 return self.name |
109 | 109 |