[Django] #24950: Add unicode_literals to startapp's template models.py

22 views
Skip to first unread message

Django

unread,
Jun 7, 2015, 2:36:08 PM6/7/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
------------------------------------------------+------------------------
Reporter: MarkusH | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/24950>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 7, 2015, 2:42:50 PM6/7/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Would it make sense to do this only on Python 2?

--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:1>

Django

unread,
Jun 7, 2015, 2:54:54 PM6/7/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by MarkusH):

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).

--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:2>

Django

unread,
Jun 7, 2015, 8:16:40 PM6/7/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:3>

Django

unread,
Jun 9, 2015, 6:24:47 PM6/9/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* Attachment "24950.diff" added.

Django

unread,
Jun 9, 2015, 6:27:48 PM6/9/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:4>

Django

unread,
Jun 9, 2015, 7:54:07 PM6/9/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by MarkusH):

I'd like to think that, too, Tim. But I don't see that happening for the
next year or two.

--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:5>

Django

unread,
Jun 10, 2015, 10:30:24 AM6/10/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
--------------------------------------+------------------------------------

Reporter: MarkusH | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:6>

Django

unread,
Jun 11, 2015, 10:34:33 AM6/11/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:7>

Django

unread,
Jun 11, 2015, 10:38:39 AM6/11/15
to django-...@googlegroups.com
#24950: Add unicode_literals to startapp's template models.py
-------------------------------------+-------------------------------------
Reporter: MarkusH | Owner: nobody
Type: | Status: closed
Cleanup/optimization |

Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Markus Holtermann <info@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"5d428908218e3692d1bc7e4ada6235029ae9e45c" 5d42890]:
{{{
#!CommitTicketReference repository=""
revision="5d428908218e3692d1bc7e4ada6235029ae9e45c"
Fixed #24950 -- Added unicode_literals to models.py in app template

Thanks Tim Graham for the patch
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24950#comment:8>

Reply all
Reply to author
Forward
0 new messages