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
- Redirect Multiple Domains to a Single Domain by rpoulton 5 years, 7 months ago
- Sophisticated order_by sorting by mawi 5 months, 2 weeks ago
- Limit ForeignKey filter values to those that have a relationship with current model by overclocked 2 years, 6 months ago
- IsNullFieldListFilter by ssokolow 11 months ago
- Severity codes in user messages by cconnell 4 years, 4 months ago
Comments