From 174c475ec79092776042df2a728aea40d755385b Mon Sep 17 00:00:00 2001 From: Sam Wenham Date: Tue, 17 Apr 2018 21:51:39 +0100 Subject: [PATCH] Add default BooleanField(default=False) for django 1.7 compatibility --- core/forms.py | 2 +- core/models.py | 10 +++++----- core/models_survex.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/forms.py b/core/forms.py index 5adb7a1..ae046b5 100644 --- a/core/forms.py +++ b/core/forms.py @@ -136,7 +136,7 @@ def getTripForm(expedition): names = ["-----"] + names name = forms.ChoiceField([(n, n) for n in names]) TU = forms.FloatField(required=False) - author = forms.BooleanField(required=False) + author = forms.BooleanField(required=False, default=False) PersonTripFormSet = formset_factory(PersonTripForm, extra=1) diff --git a/core/models.py b/core/models.py index 28efaac..a78e49b 100644 --- a/core/models.py +++ b/core/models.py @@ -125,7 +125,7 @@ class ExpeditionDay(TroggleModel): class Person(TroggleModel): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) - is_vfho = models.BooleanField(help_text="VFHO is the Vereines für Höhlenkunde in Obersteier, a nearby Austrian caving club.") + is_vfho = models.BooleanField(help_text="VFHO is the Vereines für Höhlenkunde in Obersteier, a nearby Austrian caving club.", default=False) mug_shot = models.CharField(max_length=100, blank=True,null=True) blurb = models.TextField(blank=True,null=True) @@ -134,7 +134,7 @@ class Person(TroggleModel): #the below have been removed and made methods. I'm not sure what the b in bisnotable stands for. - AC 16 Feb #notability = models.FloatField() # for listing the top 20 people - #bisnotable = models.BooleanField() + #bisnotable = models.BooleanField(default=False) user = models.OneToOneField(User, null=True, blank=True) def get_absolute_url(self): return urlparse.urljoin(settings.URL_ROOT,reverse('person',kwargs={'first_name':self.first_name,'last_name':self.last_name})) @@ -312,7 +312,7 @@ class PersonTrip(TroggleModel): #date = models.DateField() #MJG wants to KILL THIS (redundant information) time_underground = models.FloatField(help_text="In decimal hours") logbook_entry = models.ForeignKey(LogbookEntry) - is_logbook_entry_author = models.BooleanField() + is_logbook_entry_author = models.BooleanField(default=False) # sequencing by person (difficult to solve locally) @@ -371,7 +371,7 @@ class CaveAndEntrance(models.Model): class CaveSlug(models.Model): cave = models.ForeignKey('Cave') slug = models.SlugField(max_length=50, unique = True) - primary = models.BooleanField() + primary = models.BooleanField(default=False) class Cave(TroggleModel): @@ -546,7 +546,7 @@ class OtherCaveName(TroggleModel): class EntranceSlug(models.Model): entrance = models.ForeignKey('Entrance') slug = models.SlugField(max_length=50, unique = True) - primary = models.BooleanField() + primary = models.BooleanField(default=False) class Entrance(TroggleModel): name = models.CharField(max_length=100, blank=True,null=True) diff --git a/core/models_survex.py b/core/models_survex.py index 645d851..f6b3284 100644 --- a/core/models_survex.py +++ b/core/models_survex.py @@ -213,7 +213,7 @@ class SurvexScanSingle(models.Model): class TunnelFile(models.Model): tunnelpath = models.CharField(max_length=200) tunnelname = models.CharField(max_length=200) - bfontcolours = models.BooleanField() + bfontcolours = models.BooleanField(default=False) survexscansfolders = models.ManyToManyField("SurvexScansFolder") survexscans = models.ManyToManyField("SurvexScanSingle") survexblocks = models.ManyToManyField("SurvexBlock")