diff 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
line wrap: on
line diff
--- a/band/models.py	Thu Apr 02 18:57:16 2015 -0500
+++ b/band/models.py	Thu Apr 02 19:03:46 2015 -0500
@@ -15,7 +15,7 @@
     photo = models.ImageField(upload_to='images/bio/', blank=True)
     order = models.SmallIntegerField(
         help_text = "Controls order of display; lower numbers displayed first")
-    is_active = models.BooleanField()
+    is_active = models.BooleanField(default=True)
     start_date = models.DateField()
     end_date = models.DateField(blank=True,
         null=True,
@@ -101,7 +101,7 @@
     name = models.CharField(max_length=64)
     desc = models.TextField()
     price = models.DecimalField(max_digits=5, decimal_places=2)
-    in_stock = models.BooleanField()
+    in_stock = models.BooleanField(default=True)
     photo = models.ForeignKey(Photo)
 
     def __unicode__(self):