1 2 3 4 5 6 7 8 9 10 11 12 13 | from django.db import models
class UnicodeReprMixIn(object):
"""
Adds a unicode representation using self._unicode.
"""
def __unicode__(self):
"""
Unocode representation of this instance.
"""
return unicode(self.__getattribute__(self._unicode))
|
More like this
- Bind Administration by ashcrow 4 years, 8 months ago
- Modifying the fields of a third/existing model class by marinho 2 years, 4 months ago
- DownloadView generic class view by ckniffen 1 year, 8 months ago
- Ordered items in the database - alternative by Leonidas 5 years, 11 months ago
- Signal to post new saved objects to Twitter by arthurfurlan 4 years, 2 months ago
Comments
If you don't like the snippet please comment on what would make it better ;-).
#