]> git.ozlabs.org Git - patchwork/commit
models: Implement __unicode__ in models instead of __str__
authorDirk Wallenstein <halsmit@t-online.de>
Sat, 15 Jan 2011 01:16:21 +0000 (01:16 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 11 Feb 2011 00:54:27 +0000 (08:54 +0800)
commit47c56dfaceefaa44e5057236a5b63a05f68a981d
tree76a1e54fc64bee32610719d3cf3ab0c5d6746b49
parentdf79fa039b310ec648e4f027c47980101795a1d8
models: Implement __unicode__ in models instead of __str__

According to the Django documentation at [1] it is recommended to
implement __unicode__ and not __str__.  Django's model base class
provides a __str__ method that will use the __unicode__ method and
convert to utf-8.  Also, every text value returned from the DB through
the model is unicode.

It is now possible to edit Patches and Persons that have values with
non-ASCII characters through the admin interface.

[1] http://docs.djangoproject.com/en/1.2/ref/unicode/

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/models.py