We should use __unicode__ since we're using python 2.x :)
This commit is contained in:
parent
4e15a4c77b
commit
faeab77276
|
@ -5,7 +5,6 @@ from django.utils.text import slugify
|
||||||
|
|
||||||
from utils.models import CreatedUpdatedModel
|
from utils.models import CreatedUpdatedModel
|
||||||
|
|
||||||
from unidecode import unidecode
|
|
||||||
|
|
||||||
class EventType(CreatedUpdatedModel):
|
class EventType(CreatedUpdatedModel):
|
||||||
""" Every event needs to have a type. """
|
""" Every event needs to have a type. """
|
||||||
|
@ -14,7 +13,7 @@ class EventType(CreatedUpdatedModel):
|
||||||
color = models.CharField(max_length=50)
|
color = models.CharField(max_length=50)
|
||||||
light_text = models.BooleanField(default=False)
|
light_text = models.BooleanField(default=False)
|
||||||
|
|
||||||
def __str__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,12 +30,12 @@ class Event(CreatedUpdatedModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['title']
|
ordering = ['title']
|
||||||
|
|
||||||
def __str__(self):
|
def __unicode__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
def save(self, **kwargs):
|
def save(self, **kwargs):
|
||||||
if not self.slug:
|
if not self.slug:
|
||||||
self.slug = slugify(unidecode(self.title))
|
self.slug = slugify(self.title)
|
||||||
super(Event, self).save(**kwargs)
|
super(Event, self).save(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,11 +55,11 @@ class Speaker(CreatedUpdatedModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['name']
|
ordering = ['name']
|
||||||
|
|
||||||
def __str__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def save(self, **kwargs):
|
def save(self, **kwargs):
|
||||||
if not self.slug:
|
if not self.slug:
|
||||||
self.slug = slugify(unidecode(self.name))
|
self.slug = slugify(self.name)
|
||||||
super(Speaker, self).save(**kwargs)
|
super(Speaker, self).save(**kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue