Re: Templates in models and i18n.

2009-04-12 Thread Poromenos
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

Templates in models and i18n.

2009-04-12 Thread Poromenos
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 }}"))

Generic relations and unit tests.

2009-04-10 Thread Poromenos
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

Re: i18n/setlang no longer support GET

2007-12-19 Thread Poromenos
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

Re: auth system - check if user already exists

2007-08-05 Thread Poromenos
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

Re: Internationalization and HTTP headers.

2006-08-05 Thread Poromenos
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

Internationalization and HTTP headers.

2006-08-05 Thread Poromenos
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

Overriding template blocks in code

2006-06-28 Thread Poromenos
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

Re: Global template tags

2006-06-28 Thread Poromenos
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,

Global template tags

2006-06-28 Thread Poromenos
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