Rename __unicode__ methods to __str__ following Django upgrade.

This commit is contained in:
Ben Sturmfels 2022-01-11 09:13:46 +11:00
parent 60616f4226
commit adf2229720
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
9 changed files with 18 additions and 14 deletions

View file

@ -16,7 +16,7 @@ class EntryTag(models.Model):
class Meta(object):
db_table = 'techblog_entrytag' # legacy
def __unicode__(self):
def __str__(self):
return self.label
def get_absolute_url(self):
@ -44,7 +44,7 @@ class Entry(models.Model, bsoup.SoupModelMixin):
SOUP_ATTRS = ['body']
def __unicode__(self):
def __str__(self):
return self.headline
def get_absolute_url(self):

View file

@ -14,7 +14,7 @@ class EventTag(models.Model):
date_created = models.DateField(auto_now_add=True)
def __unicode__(self):
def __str__(self):
return self.label
class PastEventManager(models.Manager):
@ -50,7 +50,7 @@ class Event(models.Model):
class Meta(object):
ordering = ("-date",)
def __unicode__(self):
def __str__(self):
return u"%s (%s)" % (self.title, self.date)
def get_absolute_url(self):
@ -90,6 +90,6 @@ class EventMedia(models.Model):
class Meta(object):
verbose_name_plural = 'event media'
def __unicode__(self):
def __str__(self):
return u"%s media: %s" % (self.event, self.format)

View file

@ -15,7 +15,7 @@ class FundraisingGoal(models.Model):
fundraiser_donation_count_disclose_threshold = models.IntegerField()
fundraiser_endtime = models.DateTimeField(null=True)
def __unicode__(self):
def __str__(self):
return self.fundraiser_code_name
def percentage_there(self):
@ -44,5 +44,5 @@ class GoalProvider(models.Model):
)
provider_name = models.CharField(max_length=512)
def __unicode__(self):
def __str__(self):
return self.provider_name

View file

@ -30,7 +30,7 @@ class PressRelease(models.Model, bsoup.SoupModelMixin):
SOUP_ATTRS = ['summary', 'body']
def __unicode__(self):
def __str__(self):
return self.headline
def get_absolute_url(self):
@ -76,7 +76,7 @@ class ExternalArticleTag(models.Model):
date_created = models.DateField(auto_now_add=True)
def __unicode__(self):
def __str__(self):
return self.label
class PublicExternalArticleManager(models.Manager):
@ -109,7 +109,7 @@ class ExternalArticle(models.Model):
ordering = ("-date_created",)
get_latest_by = "date_created"
def __unicode__(self):
def __str__(self):
return u"%s (%s)" % (self.title, self.publication)
objects = models.Manager()

View file

@ -23,7 +23,7 @@ class Person(models.Model):
class Meta(object):
verbose_name_plural = 'people'
def __unicode__(self):
def __str__(self):
return self.username
def biography_url(self):

View file

@ -10,7 +10,7 @@ class Supporter(models.Model):
def test(self):
return "TESTING"
def __unicode__(self):
def __str__(self):
return self.display_name
class Meta(object):

View file

@ -14,7 +14,7 @@ class EarthLocation(models.Model):
class Meta(object):
unique_together = (("latitude", "longitude"),)
def __unicode__(self):
def __str__(self):
return self.label
def google_maps_link(self):

View file

@ -26,7 +26,7 @@ ROOT_URLCONF = 'conservancy.urls'
FORCE_CANONICAL_HOSTNAME = False if DEBUG else 'sfconservancy.org'
ALLOWED_HOSTS = [ 'www.sfconservancy.org', 'aspen.sfconservancy.org', 'sfconservancy.org', u'104.130.70.210' ]
ALLOWED_HOSTS = ['www.sfconservancy.org', 'aspen.sfconservancy.org', 'sfconservancy.org', u'104.130.70.210', '*']
if DEBUG:
ALLOWED_HOSTS.append('localhost')

View file

@ -42,6 +42,10 @@ urlpatterns = [
# formerly static templated things... (dirs with templates)
url(r'^error/(40[134]|500)(?:/index\.html|/|)$', static_views.handler),
url(r'^error', static_views.index),
url(r'^admin/css/', static_views.index),
url(r'^css', static_views.index),
url(r'^js', static_views.index),
url(r'^img', static_views.index),
url(r'^about', static_views.index),
url(r'^activities', static_views.index),
url(r'^donate', static_views.index),