#19413: [model].__str__() disagrees with __unicode__() using python3 / django1.5b1 -----------------------------------+-------------------------------------- Reporter: xanthraxoid@… | Owner: nobody Type: Bug | Status: closed Component: Python 3 | Version: 1.5-beta-1 Severity: Normal | Resolution: invalid Keywords: str unicode admin | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -----------------------------------+--------------------------------------
Comment (by thisgenericname@…): I'm learning both Python (3.2) and Django (1.5b2) myself, but I've seem some possibly inconsistent behavior here myself: If I only define __unicode__, the list of items in the admin interface will show the default ("Foo object") name, but when editing the object itself the breadcrumb trail will display "Home › FooApp › Foo › Test 222, Test". If I define just __str__, or define both methods, the admin interface always shows the correct result. This suggests to me that something might be a little off under the hood. Furthermore, the tutorial cited in [1] specifically has a sidebar for "Why __unicode__ and not __str__", so there's already a place to mention Python 3 vs Python 2 semantics if necessary. -- Ticket URL: <https://code.djangoproject.com/ticket/19413#comment:2> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.