Opened 18 years ago
Closed 18 years ago
#4161 closed (fixed)
[unicode] Convert oldforms
Reported by: | Owned by: | Malcolm Tredinnick | |
---|---|---|---|
Component: | Uncategorized | Version: | other branch |
Severity: | Keywords: | unicode | |
Cc: | Maniac@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Oldforms are now broken since they rely heavily on explicit str()s all over the place. I have a fixed version in my local tree and will make a patch after #4152 is committed.
Attachments (1)
Change History (7)
comment:1 by , 18 years ago
Cc: | removed |
---|---|
Owner: | changed from | to
by , 18 years ago
comment:2 by , 18 years ago
Has patch: | set |
---|
This fixes displaying fields in the current admin.
Updating objects still doesn't work but it's another issue. Basically I think we should wait for newforms-admin to merge. Otherwise we'll have to chase all str()'s in the current admin.
comment:3 by , 18 years ago
Yeah, I don't know what to do about "existing admin". Actually, I think I'm going to have to convert it, because we'll be ready first (and the existing i18n string problems are hurting people). However, I am going to leave it until the absolutely last thing to do so that there's still a chance it won't need to be done.
Patch itself looks good. In django/oldforms/__init__.py
, is the explicit use of
unicode(self).encode('utf-8')
rather than smart_string(self) because you like messing with my head or for a good technical reason? I don't really mind -- so don't bother changing it -- since I suspect there's no difference here, but the fact that you are writing it this way makes me think you are doing it for a reason.
comment:4 by , 18 years ago
This explicit unicode(self) is because this same class has __unicode__
defined so we don't need smart_str to check if it's there or not. Besides wouldn't calling smart_str inside of __str__
lead to an infinite recursion?
comment:5 by , 18 years ago
Yep, good point about the recursion. I've walked into that before, too. Apparently didn't learn my lesson. :-)
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch