Gary Wilson wrote:
> And that is sort of my point. Is it confusing that text|title doesn't
> behave the same as text.title()?
no, I was unclear: the c.l.python poster found it confusing that
text.title() has such a brain-dead notion of that a word is. he
wasn't a Django user, as far as I ca
It's important to remember that when it comes to templates the target audience
consists of people who don't know Python. Trying to explain to them that
Joe'S Diner is "correct" because Python says it's correct is, well, ...
Yes, consistency is good, but this is an exception.
Jacob
--~--~--
On 11/17/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> someone recently complained that str.title() wasn't quite as clever as
> text|title
> over at comp.lang.python, so I assume that whatever you do, someone will
> think it's doing the wrong thing.
And that is sort of my point. Is it confusin
> The current filters work for me as they are, and I can see how changing
> them may cause problems for me (capfirst will not convert an acronym
> like NASA to lower case, whereas capitalize will).
Yes, I think will all of these that it depends on the data you have to
start with. If you have acr
Gary Wilson wrote:
> I did realize an example where the title filter's implementation would
> be desired. When you've got a possessive noun:
>
Template("{{ text|title }}").render(Context({"text": "the boy's blob"}))
> "The Boy's Blob"
>
> as opposed to:
"the boy's blob".title()
> "The
> So, I am proposing:
> 1) Adding a capitalize filter that mimicks str.capitalize.
> 2) Adding comments as to why the title filter doesn't simply return
> the output from str.title.
> 3) Renaming the current title filter and adding a title filter that
> mimicks str.title.
> 4) Removing the cap
Waylan Limberg wrote:
> On 11/16/06, Gary Wilson <[EMAIL PROTECTED]> wrote:
> > I did realize an example where the title filter's implementation would
> > be desired. When you've got a possessive noun:
> >
> > >>> Template("{{ text|title }}").render(Context({"text": "the boy's blob"}))
> > "The B
On 11/16/06, Gary Wilson <[EMAIL PROTECTED]> wrote:
>
> Gary Wilson wrote:
> > So why the special cases? Should we keep the filters consistent with
> > their str methods?
> > title -> str.title()
>
> I did realize an example where the title filter's implementation would
> be desired. When you've
Gary Wilson wrote:
> So why the special cases? Should we keep the filters consistent with
> their str methods?
> title -> str.title()
I did realize an example where the title filter's implementation would
be desired. When you've got a possessive noun:
>>> Template("{{ text|title }}").render(Con
Is there a reason why the capfirst and title template filters don't
simply use the capitalize() and title() str methods?
The difference with capfirst is that it capitalizes the first character
without touching the others
>>> Template("{{ name|capfirst }}").render(C
10 matches
Mail list logo