Changeset - a5cd6ab63b9a
[Not reviewed]
0 4 0
Bradley Kuhn (bkuhn) - 9 years ago 2015-03-09 01:00:50
bkuhn@ebb.org
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.
4 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/contacts/models.py
Show inline comments
...
 
@@ -3,11 +3,11 @@ from django.db import models
 
class ContactEntry(models.Model):
 
    """Conservancy contact system
 

	
 
    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',)
 

	
www/conservancy/apps/events/models.py
Show inline comments
...
 
@@ -30,13 +30,13 @@ class FutureEventManager(models.Manager):
 

	
 
class Event(models.Model):
 
    """Model for Conservancy staff member events (presentations, etc)"""
 

	
 
    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)
 
    people = models.ManyToManyField(Person, null=True, blank=True)
 
    location = models.CharField(max_length=1000)
 
    earth_location = models.ForeignKey(EarthLocation, null=True, blank=True,
...
 
@@ -78,13 +78,13 @@ class EventMedia(models.Model):
 
                                       ('V', 'Video')))
 
    local = models.CharField(max_length=300, blank=True,
 
                             help_text="Local filename of the resource.  File should be uploaded into the static directory that corresponds to the event.")
 
    # 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)
 

	
 
    class Meta:
 
        verbose_name_plural = 'event media'
www/conservancy/apps/news/models.py
Show inline comments
...
 
@@ -87,13 +87,13 @@ class ExternalArticle(models.Model):
 
    info = models.CharField(help_text="subscribers only? audio? pdf warning?",
 
                            blank=True, max_length=300)
 
    publication = models.CharField("source of article", max_length=300)
 
    # 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)
 
    event = models.ForeignKey(Event, null=True, blank=True)
 
    press_release = models.ForeignKey(PressRelease, null=True, blank=True)
 

	
www/conservancy/apps/summit_registration/models.py
Show inline comments
...
 
@@ -6,11 +6,11 @@ class SummitRegistration(models.Model):
 
    name = models.CharField(max_length=300)
 
    affiliation = models.CharField(max_length=700, blank=True)
 
    address = models.TextField(blank=True)
 
    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',)
 

	
0 comments (0 inline, 0 general)