1 2 3 4 5 6 7 8 9 10 | class List(models.Model):
profile = models.ForeignKey(Profile)
def __unicode__(self):
# Represent instance with 's on end unless person's name ends with s
if unicode(self.profile)[-1] == 's':
return "%s' bucketlist" % self.profile
else:
return "%s's bucketlist" % self.profile
|
More like this
- gettext parachut for python 2.3 with unicode and utf-8 by angerman 4 years, 11 months ago
- Validation for full e-mails (e.g. "Joe Hacker <joe@hacker.com>") by akaihola 1 month, 2 weeks ago
- Convert Unicode to ASCII by coordt 4 years ago
- UnicodeReprMixIn by ashcrow 3 years, 1 month ago
- The model field subclass returns string generated from the list of choices. by I159 2 months, 3 weeks ago
Comments