Opened 10 years ago
Closed 10 years ago
#24950 closed Cleanup/optimization (fixed)
Add unicode_literals to startapp's template models.py
Reported by: | Markus Holtermann | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Markus Holtermann | Triage Stage: | Ready for checkin |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
When creating a new app using the startapp
django-admin command, the included models.py
file does not contain a from __future__ import unicode_literals
. In order to drive the use of unicode forwards we should include that line.
Attachments (1)
Change History (9)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
I don't see how you would distinguish between projects running on Python 2 only and those supporting Python 2 and Python 3 in parallel. As far as I know, adding this import does not break anything on Python 3 (any release).
comment:3 by , 10 years ago
I think that for end-user projects (which I assume is the common case for using startapp) the need to support Python 2 and 3 is rather uncommon. I'd rather promote Python 3 than add cruft that only has benefit on Python 2. Feel free to enhance your arguments if you feel otherwise.
by , 10 years ago
Attachment: | 24950.diff added |
---|
comment:4 by , 10 years ago
There's a tentative implementation that needs I test I guess, although I have mixed feelings about whether to accept or reject this ticket as I'd like to think most new projects are using Python 3. :-) Of course, there may be existing projects starting new apps on Python 2.
comment:5 by , 10 years ago
I'd like to think that, too, Tim. But I don't see that happening for the next year or two.
comment:6 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
I just think our time could be better spent, but if you have interest, might as well just do it rather than spend time debating.
comment:7 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Would it make sense to do this only on Python 2?