[unicode] Unicode models
|Reported by:||Ivan Sagalaev <Maniac@…>||Owned by:||adrian|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||mtredinnick, Maniac@…||Triage Stage:||Unreviewed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Models has to output their data from __unicode__ method, not __str__ as it is used now. I have a working code that does roughly this: changes current __str__ to __unicode__ and defines a __str__ as unicode(self).encode(settings.DEFAULT_CHARSET).
The big part is documenting the change: users should use __unicode__ instead of __str__ for their model classes. If there's no principal objections I could make a patch.
Change History (4)
comment:1 Changed 7 years ago by mtredinnick
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to wontfix
- Status changed from new to closed