﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
4921	django.contrib.admin ignores __str__ on model instances	Ludvig Ericson <ludvig.ericson@…>	Adrian Holovaty	"My apologies if this has been reported already -- I did search and couldn't find anything.

django.contrib.admin calls {{{str()}}} on model instances when listing them by default which is not in accordance with the new unicode change, I've defined {{{__unicode__}}} on my models and not {{{__str__}}}. Note also:
{{{
#!python
>>> class Foo(object):
...     def __str__(self):
...             return ""Normal python str.""
... 
>>> unicode(Foo())
u'Normal python str.'
}}}
That is, python calls the {{{__str__}}} method and converts it. Behavior verified in python 2.3, so I see no compatibility issue.

I'd guess I can make up a patch but I'm not sure if this is me being silly or if this actually is an issue.

For now I just do this:
{{{
#!python
class MyModel(models.Model):
    some_field = models.CharField()
    
    def __unicode__(self):
        return u""foo: %s"" % (self.some_field,)
    __str__ = lambda s: str(s.__unicode__())
}}}"		closed	contrib.admin	dev		invalid	admin unicode listing		Accepted	0	0	0	0	0	0
