From d9d28cf439d74167660b5249c6f5088e4a2ead8a Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Fri, 13 Oct 2023 12:44:28 +1100 Subject: [PATCH] Update podjango model __str__ methods for newer Django --- www/podjango/apps/cast/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/podjango/apps/cast/models.py b/www/podjango/apps/cast/models.py index a43809ff..607ad74e 100644 --- a/www/podjango/apps/cast/models.py +++ b/www/podjango/apps/cast/models.py @@ -19,9 +19,9 @@ from django.db import models from django.conf import settings from django.urls import reverse -#from podjango.apps.staff.models import Person from datetime import datetime, timedelta + class CastTag(models.Model): """Tagging for casts""" @@ -31,12 +31,13 @@ class CastTag(models.Model): class Meta: db_table = 'cast_tags' # legacy - def __unicode__(self): + def __str__(self): return self.label def get_absolute_url(self): return reverse('podjango:cast') + "?tag=%s" % self.slug + class Cast(models.Model): """Cast""" @@ -45,7 +46,6 @@ class Cast(models.Model): summary = models.TextField(help_text="Use raw HTML. This summary is not included at the beginning of the body when the entry is displayed. It used only for the material on the front page.") body = models.TextField(help_text="Use raw HTML. Include the full body of any show notes or other information about this episode. It will be labelled on the site as Show Notes. It is included on the detail entry, and in the description data on the cast RSS feed.") pub_date = models.DateTimeField() -# poster = models.ForeignKey(Person) tags = models.ManyToManyField(CastTag, blank=True) ogg_path = models.CharField(max_length=300, blank=True, help_text="Local filename of the Ogg file, relative to webroot. File should be uploaded into the static media area for casts.") @@ -63,7 +63,7 @@ class Cast(models.Model): ordering = ('-pub_date',) get_latest_by = 'pub_date' - def __unicode__(self): + def __str__(self): return self.title def get_absolute_url(self):