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))
|
Comments
If you don't like the snippet please comment on what would make it better ;-).
#