Ticket #4109: 4109.diff

File 4109.diff, 3.5 KB (added by Ivan Sagalaev <Maniac@…>, 8 years ago)

Patch

  • django/contrib/redirects/models.py

     
    2020        list_filter = ('site',)
    2121        search_fields = ('old_path', 'new_path')
    2222
    23     def __str__(self):
    24         return "%s ---> %s" % (self.old_path, self.new_path)
     23    def __unicode__(self):
     24        return u"%s ---> %s" % (self.old_path, self.new_path)
  • django/contrib/sites/models.py

     
    1919        list_display = ('domain', 'name')
    2020        search_fields = ('domain', 'name')
    2121
    22     def __str__(self):
     22    def __unicode__(self):
    2323        return self.domain
  • django/contrib/contenttypes/models.py

     
    4242        ordering = ('name',)
    4343        unique_together = (('app_label', 'model'),)
    4444
    45     def __str__(self):
     45    def __unicode__(self):
    4646        return self.name
    4747
    4848    def model_class(self):
  • django/contrib/auth/models.py

     
    4545        unique_together = (('content_type', 'codename'),)
    4646        ordering = ('content_type', 'codename')
    4747
    48     def __str__(self):
    49         return "%s | %s | %s" % (self.content_type.app_label, self.content_type, self.name)
     48    def __unicode__(self):
     49        return u"%s | %s | %s" % (self.content_type.app_label, self.content_type, self.name)
    5050
    5151class Group(models.Model):
    5252    """Groups are a generic way of categorizing users to apply permissions, or some other label, to those users. A user can belong to any number of groups.
     
    6666    class Admin:
    6767        search_fields = ('name',)
    6868
    69     def __str__(self):
     69    def __unicode__(self):
    7070        return self.name
    7171
    7272class UserManager(models.Manager):
     
    122122        list_filter = ('is_staff', 'is_superuser')
    123123        search_fields = ('username', 'first_name', 'last_name', 'email')
    124124
    125     def __str__(self):
     125    def __unicode__(self):
    126126        return self.username
    127127
    128128    def get_absolute_url(self):
     
    262262    user = models.ForeignKey(User)
    263263    message = models.TextField(_('message'))
    264264
    265     def __str__(self):
     265    def __unicode__(self):
    266266        return self.message
    267267
    268268class AnonymousUser(object):
     
    272272    def __init__(self):
    273273        pass
    274274
    275     def __str__(self):
    276         return 'AnonymousUser'
     275    def __unicode__(self):
     276        return u'AnonymousUser'
    277277
    278278    def __eq__(self, other):
    279279        return isinstance(other, self.__class__)
  • django/contrib/flatpages/models.py

     
    2626        list_filter = ('sites',)
    2727        search_fields = ('url', 'title')
    2828
    29     def __str__(self):
    30         return "%s -- %s" % (self.url, self.title)
     29    def __unicode__(self):
     30        return u"%s -- %s" % (self.url, self.title)
    3131
    3232    def get_absolute_url(self):
    3333        return self.url
Back to Top