Patrick J. Anderson wrote:
class MyModel(models.Model):
text_en = TextField()
text_pt-br = TextField()
Django complains with a SyntaxError: can't assign to operator on
"text_pt-br = TextField()" line
This just what I did in my models, but perhaps
On Thu, 11 Jan 2007 16:58:34 -0600, Jacob Kaplan-Moss wrote:
On 1/11/07 2:35 PM, Nuno Mariz wrote:
Any idea to resolve this , this don't scale. If I what to add another
language, I have to patch all of my templates.
If I were you, I'd write a simple accessor on your model to get the current
Jacob Kaplan-Moss wrote:
> On 1/11/07 2:35 PM, Nuno Mariz wrote:
>> Any idea to resolve this , this don't scale. If I what to add another
>> language, I have to patch all of my templates.
>
> If I were you, I'd write a simple accessor on your model to get the current
> translation. Off the
On 1/11/07 2:35 PM, Nuno Mariz wrote:
> Any idea to resolve this , this don't scale. If I what to add another
> language, I have to patch all of my templates.
If I were you, I'd write a simple accessor on your model to get the current
translation. Off the top of my head, you could do
I have a internationalization problem to solve in the template system.
In my model:
[...]
text_pt = TextField()
text_en = TextField()
[...]
In my template:
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% ifequal LANGUAGE_CODE 'en' %}
{{ object.text_en }}
{% else %}
{{
5 matches
Mail list logo