From a5cd6ab63b9a353139ac185346fee4daa3b43fa5 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 8 Mar 2015 18:00:50 -0700 Subject: [PATCH] Make defaults for BooleanFields. According to django-admin check, (1_6.W002) BooleanField does not have a default value. HINT: Django 1.6 changed the default value of BooleanField from False to None. See https://docs.djangoproject.com/en/1.6/ref/models/fields/#booleanfield for more information. --- www/conservancy/apps/contacts/models.py | 2 +- www/conservancy/apps/events/models.py | 4 ++-- www/conservancy/apps/news/models.py | 2 +- www/conservancy/apps/summit_registration/models.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/www/conservancy/apps/contacts/models.py b/www/conservancy/apps/contacts/models.py index bc02a865..4cd4d1ef 100644 --- a/www/conservancy/apps/contacts/models.py +++ b/www/conservancy/apps/contacts/models.py @@ -6,7 +6,7 @@ class ContactEntry(models.Model): Hopefully this will be deprecated soon""" email = models.EmailField() # should make it unique, but we really cannot - subscribe_conservancy = models.BooleanField() + subscribe_conservancy = models.BooleanField(default=False) class Meta: ordering = ('email',) diff --git a/www/conservancy/apps/events/models.py b/www/conservancy/apps/events/models.py index 1bd1d20e..481f8713 100644 --- a/www/conservancy/apps/events/models.py +++ b/www/conservancy/apps/events/models.py @@ -33,7 +33,7 @@ class Event(models.Model): title = models.CharField(max_length=400) date = models.DateField() - date_tentative = models.BooleanField() + date_tentative = models.BooleanField(default=False) datetime = models.CharField("Date and Time", max_length=300, blank=True) slug = models.SlugField(unique_for_year='date') description = models.TextField(blank=True) @@ -81,7 +81,7 @@ class EventMedia(models.Model): # verify_exists removed https://docs.djangoproject.com/en/1.7/releases/1.4/ remote = models.URLField(blank=True, help_text="Remote URL of the resource. Required if 'local' is not given.") - novel = models.BooleanField(help_text="Is it a new piece of media or another form of an old one? If it is new it will be included in the event-media RSS feed and shown on the front page for a bit.") + novel = models.BooleanField(help_text="Is it a new piece of media or another form of an old one? If it is new it will be included in the event-media RSS feed and shown on the front page for a bit.", default=False) date_created = models.DateTimeField(auto_now_add=True) date_last_modified = models.DateTimeField(auto_now=True) diff --git a/www/conservancy/apps/news/models.py b/www/conservancy/apps/news/models.py index 8cb1a893..89e0cc4c 100644 --- a/www/conservancy/apps/news/models.py +++ b/www/conservancy/apps/news/models.py @@ -90,7 +90,7 @@ class ExternalArticle(models.Model): # verify_exists removed https://docs.djangoproject.com/en/1.7/releases/1.4/ url = models.URLField(blank=True) date = models.DateField() - visible = models.BooleanField(help_text="Whether to display on website") + visible = models.BooleanField(help_text="Whether to display on website", default=True) tags = models.ManyToManyField(ExternalArticleTag, null=True, blank=True) people = models.ManyToManyField(Person, null=True, blank=True) diff --git a/www/conservancy/apps/summit_registration/models.py b/www/conservancy/apps/summit_registration/models.py index 2c5cf919..1bb0dc95 100644 --- a/www/conservancy/apps/summit_registration/models.py +++ b/www/conservancy/apps/summit_registration/models.py @@ -9,7 +9,7 @@ class SummitRegistration(models.Model): email = models.EmailField(blank=True) phone = models.CharField(max_length=100, blank=True) date_created = models.DateField(auto_now_add=True) - cle_credit = models.BooleanField(null=True) + cle_credit = models.BooleanField(default=True) class Meta: ordering = ('name',)