UnicodeReprMixIn

 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

  1. Bind Administration by ashcrow 4 years, 8 months ago
  2. Modifying the fields of a third/existing model class by marinho 2 years, 4 months ago
  3. DownloadView generic class view by ckniffen 1 year, 8 months ago
  4. Ordered items in the database - alternative by Leonidas 5 years, 11 months ago
  5. Signal to post new saved objects to Twitter by arthurfurlan 4 years, 2 months ago

Comments

ashcrow (on January 18, 2009):

If you don't like the snippet please comment on what would make it better ;-).

#

(Forgotten your password?)