Changeset - e9df3a0d7e2c
[Not reviewed]
0 3 0
Ben Sturmfels (bsturmfels) - 2 years ago 2021-12-17 06:25:38
ben@sturm.com.au
Remove unnecessary null=True on ManyToManyFields.
3 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/blog/models.py
Show inline comments
...
 
@@ -22,25 +22,25 @@ class EntryTag(models.Model):
 
    def get_absolute_url(self):
 
        return u"/blog/?tag=%s" % self.slug
 

	
 
class Entry(models.Model, bsoup.SoupModelMixin):
 
    """Blog entry"""
 

	
 
    headline = models.CharField(max_length=200)
 
    slug = models.SlugField(unique_for_date='pub_date')
 
    summary = models.TextField(help_text="Use raw HTML.  Unlike in the press release model, this summary is not included at the beginning of the body when the entry is displayed.")
 
    body = models.TextField(help_text="Use raw HTML.  Include the full body of the post.")
 
    pub_date = models.DateTimeField()
 
    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_last_modified = models.DateTimeField(auto_now=True)
 

	
 
    class Meta(object):
 
        db_table = 'techblog_entries' # legacy
 
        verbose_name_plural = 'entries'
 
        ordering = ('-pub_date',)
 
        get_latest_by = 'pub_date'
 

	
 
    SOUP_ATTRS = ['body']
 

	
www/conservancy/apps/events/models.py
Show inline comments
...
 
@@ -29,29 +29,29 @@ class FutureEventManager(models.Manager):
 
    def get_queryset(self):
 
        return super(FutureEventManager, self).get_queryset().filter(date__gte=datetime.today())
 

	
 
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(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)
 
    people = models.ManyToManyField(Person, blank=True)
 
    location = models.CharField(max_length=1000)
 
    earth_location = models.ForeignKey(EarthLocation, null=True, blank=True,
 
                                       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_last_modified = models.DateTimeField(auto_now=True)
 

	
 
    class Meta(object):
 
        ordering = ("-date",)
 

	
 
    def __unicode__(self):
 
        return u"%s (%s)" % (self.title, self.date)
 

	
 
    def get_absolute_url(self):
 
        return u"/events/%s/%s/" % (self.date.strftime("%Y"), self.slug)
www/conservancy/apps/news/models.py
Show inline comments
...
 
@@ -89,26 +89,26 @@ class ExternalArticle(models.Model):
 
    (Currently unused)
 
    """
 

	
 
    title = models.CharField(max_length=400)
 
    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", default=True)
 

	
 
    tags = models.ManyToManyField(ExternalArticleTag, null=True, blank=True)
 
    people = models.ManyToManyField(Person, null=True, blank=True)
 
    tags = models.ManyToManyField(ExternalArticleTag, blank=True)
 
    people = models.ManyToManyField(Person, blank=True)
 
    event = models.ForeignKey(Event, null=True, blank=True)
 
    press_release = models.ForeignKey(PressRelease, null=True, blank=True)
 

	
 
    date_created = models.DateField(auto_now_add=True)
 

	
 
    class Meta(object):
 
        ordering = ("-date_created",)
 
        get_latest_by = "date_created"
 

	
 
    def __unicode__(self):
 
        return u"%s (%s)" % (self.title, self.publication)
 

	
0 comments (0 inline, 0 general)