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
- YAAS (Yet Another Auto Slug) by carljm 3 years, 8 months ago
- slug filename by willhardy 2 years, 6 months ago
- Human readable file names decorator by maxk 10 months, 1 week ago
- Ordered items in the database - alternative by Leonidas 4 years, 8 months ago
- A ModelChoiceField with support for title in options based on a field in the model by celopes 1 year, 6 months ago
Comments
If you don't like the snippet please comment on what would make it better ;-).
#