Changes between Initial Version and Version 1 of Ticket #23982, comment 4
- Timestamp:
- Dec 11, 2014, 11:46:35 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23982, comment 4
initial v1 1 1 Yes, charettes and bmispelon are right, this is a bug in the app, not a bug in migrations. 2 2 3 Migrations are correctly and consistently recording the `verbose_name` as a bytestring when it is a bytestring, and as a text (unicode) string when it is a text string, and noticing the difference when it changes. (Note that migration files always have `from __future__ import unicode `, so an unmarked string is always a unicode string, on Python 2 or 3). That's the only sane behavior for migrations (and it was arrived at with a great deal of trial and error :-) ).3 Migrations are correctly and consistently recording the `verbose_name` as a bytestring when it is a bytestring, and as a text (unicode) string when it is a text string, and noticing the difference when it changes. (Note that migration files always have `from __future__ import unicode_literals`, so an unmarked string is always a unicode string, on Python 2 or 3). That's the only sane behavior for migrations (and it was arrived at with a great deal of trial and error :-) ). 4 4 5 5 The app, per our [[https://docs.djangoproject.com/en/dev/topics/python3/#unicode-literals porting to Python 3 documentation]], should also be using `from __future__ import unicode_literals` so that the actual nature of the string does not change when moving between Python 2 and 3. (Or if they don't care to support 3.2, they could explicitly mark all strings with `b` or `u` if they prefer that for some reason.)