From: Charles Connell Date: Mon, 14 Apr 2014 22:33:34 +0000 (-0400) Subject: Prettier representation of models X-Git-Tag: release-20150131~140 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=45dad01ab1781e5ccfb5379157a4c1e2917e8037;p=oweals%2Fkarmaworld.git Prettier representation of models --- diff --git a/karmaworld/apps/courses/models.py b/karmaworld/apps/courses/models.py index 7b3c48d..692c67b 100644 --- a/karmaworld/apps/courses/models.py +++ b/karmaworld/apps/courses/models.py @@ -76,7 +76,7 @@ class School(models.Model): return (self.usde_id,) def __unicode__(self): - return u'School {0}: {1}'.format(self.usde_id, self.name) + return self.name def save(self, *args, **kwargs): """ Save school and generate a slug if one doesn't exist """ @@ -135,7 +135,7 @@ class Department(models.Model): unique_together = ('name', 'school',) def __unicode__(self): - return u'Department: {0} at {1}'.format(self.name, unicode(self.school)) + return self.name def natural_key(self): """ @@ -198,7 +198,7 @@ class Professor(models.Model): unique_together = ('name', 'email',) def __unicode__(self): - return u'Professor: {0} ({1})'.format(self.name, self.email) + return self.name def natural_key(self): """