[Django] #21306: Fix (or document) lower-casing behavior of title filter

11 views
Skip to first unread message

Django

unread,
Oct 22, 2013, 12:43:49 PM10/22/13
to django-...@googlegroups.com
#21306: Fix (or document) lower-casing behavior of title filter
-----------------------------------------+------------------------
Reporter: timo | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The following seems unexpected to me, although there may be use cases
where it's expected behavior (e.g. if you have all capitalized text and
want it titled). See also #21299.
{{{
>>> from django.template.defaultfilters import title
>>> title("ABC News")
u'Abc News'
}}}

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

Django

unread,
Oct 23, 2013, 7:35:56 AM10/23/13
to django-...@googlegroups.com
#21306: Fix (or document) lower-casing behavior of title filter
---------------------------------+------------------------------------

Reporter: timo | Owner: nobody
Type: Uncategorized | Status: new
Component: Template system | Version: 1.4
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 bmispelon):

* cc: bmispelon@… (added)
* component: Uncategorized => Template system
* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

That behavior is consistent with python's `str.title` method [1].

Django's `title` function has two features on top of `str.title`:
* `title("isn't it") == "Isn't It"` (whereas `"isn't it".title() == "Isn'T
It`)
* `title("8foo") == "8foo"` (whereas `"8foo".title() == "8Foo"`)

I don't think we can fix this particular issue without breaking backwards-
compatibility so I think documenting it is the best course of action.

[1]
http://docs.python.org/2/library/stdtypes.html?highlight=str.title#str.title

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

Django

unread,
Oct 23, 2013, 7:37:33 AM10/23/13
to django-...@googlegroups.com
#21306: Fix (or document) lower-casing behavior of title filter
--------------------------------------+------------------------------------
Reporter: timo | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | 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 timo):

* type: Uncategorized => Cleanup/optimization
* version: 1.4 => master
* component: Template system => Documentation


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

Django

unread,
Oct 30, 2013, 9:35:05 AM10/30/13
to django-...@googlegroups.com
#21306: Fix (or document) lower-casing behavior of title filter
--------------------------------------+------------------------------------
Reporter: timo | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"eafe279120e7e6ebe7b6d42443366088ba1a50c8"]:
{{{
#!CommitTicketReference repository=""
revision="eafe279120e7e6ebe7b6d42443366088ba1a50c8"
Fixed #21306 -- Documented lower-casing behavior of title filter.
}}}

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

Django

unread,
Oct 30, 2013, 9:35:30 AM10/30/13
to django-...@googlegroups.com
#21306: Fix (or document) lower-casing behavior of title filter
--------------------------------------+------------------------------------
Reporter: timo | Owner: nobody

Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d774cb219c4581461bd2310450605916dd7c13e6"]:
{{{
#!CommitTicketReference repository=""
revision="d774cb219c4581461bd2310450605916dd7c13e6"
[1.6.x] Fixed #21306 -- Documented lower-casing behavior of title filter.

Backport of eafe279120 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages