Ticket 9483

1 view
Skip to first unread message

H. de Vries

unread,
Nov 4, 2008, 8:08:01 AM11/4/08
to Django developers
Hey all,

I pretty new to developing for Django itself and for that reason I
have question.

4 days ago I submitted a bug and I wrote a patch and tests for it. I
noticed through the timeline that there are people that review
tickets.

Problem is, I haven't had any response on my ticket yet. How long does
it usually take for someone to review a ticket that has a patch and
tests?

I know in open source projects things can sometimes take a while. It
would awesome if my patch would make it into 1.0.X ( if that isn't too
late, I just read on the blog today about the beta and the 1.0.X
branch ).

This is the ticket I'm talking about:
http://code.djangoproject.com/ticket/9483

Thanks,

Henk.

Karen Tracey

unread,
Nov 4, 2008, 8:44:29 AM11/4/08
to django-d...@googlegroups.com

Four days is not very long.  I personally have not responded on that ticket because I have no background in publishing or editing to know what the correct behavior is for converting to "title case". You assert that the current behavior is wrong, but to me it actually looks correct; I was hoping someone connected to publishing with more of a clue in this area than I would chime in, but four days has not been long enough for any such qualified people to have the time.

Regardless of what is technically correct for title casing, I'd be leery of changing the existing title filter at this point.  It seems like there may be people using it who expect the current behavior, and to suddenly change the behavior would be backwards-incompatible for them.  So my inclination would be to close that ticket as wontfix based on the fact that:

1 - the existing behavior mirrors Python so is unsurprising in a Python-based framework
2 - changing it at this point is backwards-incompatible
3 - you can easily write your own filter to title case in whatever manner you want

But like I said I don't know what is technically "correct" for title casing, so if what you are proposing is the generally accepted way than perhaps there is a case to be made for including in Django a filter that does casing that way.

Karen

H. de Vries

unread,
Nov 4, 2008, 9:26:33 AM11/4/08
to Django developers
Hey Karen,

Thanks for your fast reply.

Well, I searched around and it seems that a lot of people aren't too
happy with Python's default title() functionality. (
http://muffinresearch.co.uk/archives/2008/05/27/titlecasepy-titlecase-in-python/
)

From a publishing point of view, I don't know for sure Python's method
is correct. Personally, I don't think so. It is logical to put a
capitalized letter after a semicolon, but that's certainly not the
case if it's in a word ( Like Foo;bar, from my example ).

> 1 - the existing behavior mirrors Python so is unsurprising in a
> Python-based framework
Ok, but then you would to actually change the documentation
accordingly. It now states that it converts a string to title case and
what Python title method does is not what it "should" do. ( I already
discussed that ).

> 2 - changing it at this point is backwards-incompatible
True, maybe put this patch to 2.0?

> 3 - you can easily write your own filter to title case in whatever manner
> you want
That's also true, but you can almost override any component that is in
Django, thus saying this sounds like "Yeah, you can override
everything anyway."

So, in conclusion, I think this should be put into 2.0, under the
condition that we can confirm Python's title method isn't publishing-
friendly. We need someone in publishing to back us up on this one.
Another solution would be to change the documentation, because what we
do now probably isn't "proper" title casing.


Greets,

Henk.


On 4 nov, 14:44, "Karen Tracey" <kmtra...@gmail.com> wrote:

Hanne Moa

unread,
Nov 5, 2008, 10:36:20 AM11/5/08
to django-d...@googlegroups.com
On Tue, Nov 4, 2008 at 15:26, H. de Vries <b.hees...@gmail.com> wrote:
> Well, I searched around and it seems that a lot of people aren't too
> happy with Python's default title() functionality. (
> http://muffinresearch.co.uk/archives/2008/05/27/titlecasepy-titlecase-in-python/
> )
>
> From a publishing point of view,

Which publishing point of view? News? Tabloid? Scientific publication?
Fiction? Other? From which country? If English, which English? At what
point in time? Is there a house-style?

It might be that Python's existing titlecasing reflects international
usage, or Dutch usage (I'm not Dutch). Titlecasing is generally not
used in my country however. So, this is a localization-question
really.


HM, helpful computational linguist

Michael

unread,
Nov 5, 2008, 11:18:25 AM11/5/08
to django-d...@googlegroups.com
As someone who works with AP Style and very much knows the limitations of |title, I don't think we should change it. The current solution is eloquent, well-known and, most of all, consistent. I think if too many exceptions are put into the generic filters they will become less useful to the whole. It isn't difficult and is well documented to write your own filters to handle special cases that you might need, and that is what I do for the AP Style filters that I need on a day to day basis. 

Python's solution is consistent (no exceptions) and should be easy to understand logically to the templater and will be familiar with a programmer who might be templating. -1 to any changes that might mess up this balance to the default filters. 

My 2c, Michael 

Adam Nelson

unread,
Nov 5, 2008, 11:21:33 AM11/5/08
to django-d...@googlegroups.com
Henk,

I think the best solution is to:

A) Do a patch that defaults to the existing functionality and allows for customization (i.e. the ability to pass characters that would go into the regex).

And

B) Start a ticket and thread to change the title method for Python on the Python developer's group.  Django should follow Python in these cases: http://docs.python.org/library/stdtypes.html?highlight=title#str.title

Regards,
Adam


On Wed, Nov 5, 2008 at 10:36 AM, Hanne Moa <hann...@gmail.com> wrote:

Ludvig Ericson

unread,
Nov 7, 2008, 4:07:57 AM11/7/08
to django-d...@googlegroups.com
On Nov 4, 2008, at 15:26, H. de Vries wrote:

> From a publishing point of view, I don't know for sure Python's method
> is correct. Personally, I don't think so.

I'd have to say, if Python's misbehaving, Python should be patched.

And also, I'm strictly against making the title filter not behave as
str.title does, because let's face it, a lot of template designers are
Python programmers.

It's also really a corner case, and I wouldn't sacrifice the Python
titlecase implementation just for this one corner case (and which
legitimate words do use semicolons in the middle of them?)

- Ludvig

varikin

unread,
Nov 7, 2008, 8:46:52 AM11/7/08
to Django developers
For English (U.S. English at least), it should also not capitalize
articles (a, an, the, etc). I don't know the rules for other
languages, but I have heard they are different. So given this, if
there was an effort to make the title filter better, it might be
worthwhile to put it under the localization stuff.

Ludvig Ericson

unread,
Nov 7, 2008, 9:44:44 AM11/7/08
to django-d...@googlegroups.com
On Nov 7, 2008, at 14:46, varikin wrote:
> For English (U.S. English at least), it should also not capitalize
> articles (a, an, the, etc). I don't know the rules for other
> languages, but I have heard they are different. So given this, if
> there was an effort to make the title filter better, it might be
> worthwhile to put it under the localization stuff.

You try making an implementation of the actual English title casing
rules, and let me know how that goes. :P

str.title is a very simple title casing function, and there's a
reason for that.

Ludvig Ericson

varikin

unread,
Nov 8, 2008, 12:47:21 PM11/8/08
to Django developers

> You try making an implementation of the actual English title casing
> rules, and let me know how that goes. :P

I would prefer not, though that sounds like a challenge:)

>
> str.title is a very simple title casing function, and there's a
> reason for that.

I completely understand.

I was just suggesting if it is decided to have special title filters/
functions in Django, it might be worthwhile to have it localized.



Reply all
Reply to author
Forward
0 new messages