It's not an entire template, I'm just using the template system as an
alternative to string formatting because of its name resolution
capabilities. I found out how to do it, actually, I used ugettext
instead of lazy an it works well!
Poromenos
On 12 Απρ 2009, at 19:52, Karen Tracey <km
Hello,
I am trying to render a template in my models (to get the model
details in a printable format), but I want the template string to be
internationalised. ugettext_lazy does not return a string object, and
the template returns nothing. My code is:
template = Template(_("{{ self.name }}"))
Hello,
I created a model that has a ForeignKey to ContentType, but now I
can't use my test fixtures, since the IDs they point to are random
every time the test database is created. I can't dump the contenttypes
data because then I get many duplicate inserts, since Django rebuilds
them every time
I mistakenly replied to James instead of everyone, so I will rewrite
my reply.
My application's UI depends on the set_language view being a link, and
I don't think it should be up to the framework to force this on the
developer. It would be better if the view supported both ways and the
That's what I do (well, I just check the username, since I can't think
why you'd want to check the email). I don't think there's a better
way, it's pretty straightforward...
Poromenos
On Aug 6, 12:42 am, Aljosa Mohorovic <[EMAIL PROTECTED]>
wrote:
> i'm currently looking at django.con
Never mind, I hadn't installed the Locale middleware, apparently it's
used for HTTP header detection as well as manual language override.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
I have translated my site from English to Greek (el) and I have left
english as the fallback language (I haven't created an english .po
file), but the HTTP-header language selection doesn't work for me. If I
set the installation language it works fine, but I can't get it to
select content via the
Is there a way for me to specify template blocks in code? I want,
instead of overriding the "content" template from a file, to do it in
code. Is this possible?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Ah, that's what I needed, thanks a lot :)
--~--~-~--~~~---~--~~
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,
Is there a way for me to pass a variable in every template context
without writing custom template tags? I just want to pass the app name
because I'm not comfortable with hardcoding it, but template tags seem
too much work for something as simple as this.
Isn't there something like a globals
10 matches
Mail list logo