Groups
Groups
Sign in
Groups
Groups
django-modeltranslation
Conversations
About
Send feedback
Help
change language programmatically
37 views
Skip to first unread message
lydy...@gmail.com
unread,
Jun 27, 2015, 2:51:55 PM
6/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-mode...@googlegroups.com
I got this code:
from django.utils.translation import activate
activate("nl")
print MyObject.objects.filter(title__isnull=False).query.sql_with_params()
activate("fr")
print MyObject.objects.filter(title__isnull=False).query.sql_with_params()
As default fallback language is nl, then both queries ar translated to -> "title_nl is not null", bet in second case I want -> "title_fr is not null"
How can i programmatically change language?
p.s. there could be great idea, to implement something like MyObject.objects.language("fr")...
Reply all
Reply to author
Forward
0 new messages