On Sun, 2008-02-17 at 13:15 -0800, meppum wrote:
> thanks. semantics just got the best of me unicode object == unicode
> string.
> 
> you said before that it "Looks like it's been marked up with
> ugettext_lazy()". Is this something I've done without realizing it or
> was this just a change that was made behind the scenes to django. I
> know that unicode support has been added throughout django so I'm
> assuming that this is a change behind the scenes. Thanks again.

It's done internally. The point is that you might have marked
verbose_name as translatable. We want to add an 's' on the end, if you
don't specify verbose_name_plural, but we can't convert a translatable
object (something marked with ugettext_lazy()) back into a string by
just doing verbose_name + 's'. So we need to wrap it up so that the 's'
is only added when it is converted to Unicode. Net result: if you don't
explicitly specify verbose_name_plural, it will be a lazy translation
object. There's no real way to avoid that, but if you try to write your
code so that it always outputs unicode strings (and use smart_str()
otherwise), it will be pretty much transparent.

Malcolm

-- 
Success always occurs in private and failure in full view. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to