﻿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
1055	Models should have better default __str__() and __repr__() methods	GomoX <gomo@…>	Adrian Holovaty	"Right now, the default !__repr!__() method as defined in the Model class (in django/core/meta/!__init!__.py) looks like:
{{{
#!python
def __repr__(self):
    return '<%s object>' % self.__class__.__name__
}}}

I think we should have at least a !__str!__() definition and a better !__repr!__(), which includes at least the object id, so that when using the interactive interpreter, you can tell an object from another. Something like:

{{{
#!python
def __str__(self):
    return '%s %s' % (self.__class__.__name__, self.id)
def __repr__(self):
    return '<%s object ID=%s>' % (self.__class__.__name__, self.id)
}}}"	defect	closed	Database layer (models, ORM)		normal	fixed		gomo@…	Unreviewed	0	0	0	0	0	0
