Remove unnecessary null=True on ManyToManyFields.

This commit is contained in:
Ben Sturmfels 2021-12-17 17:25:38 +11:00
parent 47fa2b3623
commit e9df3a0d7e
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
3 changed files with 5 additions and 5 deletions

View file

@ -31,7 +31,7 @@ class Entry(models.Model, bsoup.SoupModelMixin):
body = models.TextField(help_text="Use raw HTML. Include the full body of the post.") body = models.TextField(help_text="Use raw HTML. Include the full body of the post.")
pub_date = models.DateTimeField() pub_date = models.DateTimeField()
author = models.ForeignKey(Person) author = models.ForeignKey(Person)
tags = models.ManyToManyField(EntryTag, null=True, blank=True) tags = models.ManyToManyField(EntryTag, blank=True)
date_created = models.DateTimeField(auto_now_add=True) date_created = models.DateTimeField(auto_now_add=True)
date_last_modified = models.DateTimeField(auto_now=True) date_last_modified = models.DateTimeField(auto_now=True)

View file

@ -38,11 +38,11 @@ class Event(models.Model):
datetime = models.CharField("Date and Time", max_length=300, blank=True) datetime = models.CharField("Date and Time", max_length=300, blank=True)
slug = models.SlugField(unique_for_year='date') slug = models.SlugField(unique_for_year='date')
description = models.TextField(blank=True) description = models.TextField(blank=True)
people = models.ManyToManyField(Person, null=True, blank=True) people = models.ManyToManyField(Person, blank=True)
location = models.CharField(max_length=1000) location = models.CharField(max_length=1000)
earth_location = models.ForeignKey(EarthLocation, null=True, blank=True, earth_location = models.ForeignKey(EarthLocation, null=True, blank=True,
help_text="Label will not be displayed") help_text="Label will not be displayed")
tags = models.ManyToManyField(EventTag, null=True, blank=True) tags = models.ManyToManyField(EventTag, blank=True)
date_created = models.DateTimeField(auto_now_add=True) date_created = models.DateTimeField(auto_now_add=True)
date_last_modified = models.DateTimeField(auto_now=True) date_last_modified = models.DateTimeField(auto_now=True)

View file

@ -98,8 +98,8 @@ class ExternalArticle(models.Model):
date = models.DateField() date = models.DateField()
visible = models.BooleanField(help_text="Whether to display on website", default=True) visible = models.BooleanField(help_text="Whether to display on website", default=True)
tags = models.ManyToManyField(ExternalArticleTag, null=True, blank=True) tags = models.ManyToManyField(ExternalArticleTag, blank=True)
people = models.ManyToManyField(Person, null=True, blank=True) people = models.ManyToManyField(Person, blank=True)
event = models.ForeignKey(Event, null=True, blank=True) event = models.ForeignKey(Event, null=True, blank=True)
press_release = models.ForeignKey(PressRelease, null=True, blank=True) press_release = models.ForeignKey(PressRelease, null=True, blank=True)