Simple Django model translation
Questions tagged [django-parler]
40 questions
5
votes
0 answers
How to query translatable fields with graphene
Assuming a model that has translated fields like below, how can we query these with django-graphene?
from parler.models import TranslatableModel, TranslatedFields
class Article(TranslatableModel):
#regular fields
publishing_date =…

fekioh
- 894
- 2
- 9
- 22
4
votes
2 answers
Translatable Manytomany fields in admin generate many queries
I am using django-parler (a derivative of django-hvad) for translations. In admin when displaying Foreignkey fields with manytomany relationship, django runs a single query for each:
So when there are 300 services there would be as many queries.
I…

Danial Tz
- 1,884
- 1
- 15
- 20
3
votes
0 answers
Impossible export django-parler translated fields with the common comand dumpdata
Is there any way to dump and load data with a TranslatableModel because with the common python manage.py dumpdata app.Organization -o fixtures/organizations.json Django command translated fields do not appear in the file.
models.py:
class…

Alberto Sanmartin Martinez
- 970
- 13
- 37
3
votes
2 answers
django-parler translations for abstract model
My django app must be translatable, static pages and models too. For translating models I'm using django-parler app. This works fine, but for simple models, I mean, models that doesn't inherits from an abstract model class.
Let's say that we have a…

adrian oviedo
- 684
- 1
- 8
- 27
3
votes
1 answer
In Django remove duplicates of a QuerySet when using parler
I have a model like this:
from django.db import models
from django.utils.translation import ugettext_lazy as _
from parler.models import TranslatableModel, TranslatedFields
...
class UnitNode(TranslatableModel):
...
translations =…

mogoh
- 992
- 2
- 7
- 27
3
votes
1 answer
django parler create test objects
I have models that have translatable fields using Django Parler and now I am trying to create objects for unit testing. Here is an example model that I have
class Federation(TranslatableModel):
translations = TranslatedFields(
name =…

Gasim
- 7,615
- 14
- 64
- 131
3
votes
1 answer
Django parler TranslatableSlugMixin translates from English to another language, but once translated cannot be translated back returns 404
I'm using Django CMS with Django Parler and have run into a problem that is driving me mad, so if anybody could help, it would be much appreciated!
So I'm creating a simple blog app that has the slug as a translatable field. Here is the model…

tdsymonds
- 1,679
- 1
- 16
- 26
2
votes
0 answers
Using django-import-export together with django-parler
I'm trying to import and export models using django-import-export while having TranslatedFields from django-parler.
Although I explicitly added Description to the Meta fields in ChildInsurancePlanResource it's not showing up when importing items.…

Ichbinstudent
- 21
- 1
2
votes
0 answers
Django Parler also shows translated object on the admin list
I use Django 2.2.11 and Django-parler 2.0.1.
I created a model using TranslatableModel and TranslatableAdmin. Then I created an object and filled the translatable fields of the same object for the second language. When I get to the model list page,…

selmanceker
- 61
- 1
- 3
2
votes
1 answer
Configuring multilingual content in django-cms site; list_display issue
I am trying to add multilingual support for a django-cms site on the divio platform. I believe the relevant divio docs are outdated, in that there no longer exists a "General Settings" link in the sidebar to add Languages via the divio web interface…

fekioh
- 894
- 2
- 9
- 22
2
votes
1 answer
Creating Custom Forms in the Django Admin Interface with Parler
I have a django 1.8 instance (and python 2) and I am using django-parler for translation. I want to customize the admin interface (I want to use django-autocomplete-light, but that's not relevant). But customizing the admin interface with parler…

mogoh
- 992
- 2
- 7
- 27
2
votes
1 answer
Django tabular inline with translations (parler) missing 2 required positional arguments: model and admin_site
I'm having a main object that contain a dynamic numbers of images and descriptions.
Thus, I'm using the Foreign Key / tabularinline combo!
class InstructionsModel(TranslatableModel):
instruction = models.ForeignKey(InstructionModel,…

Jay Cee
- 1,855
- 5
- 28
- 48
2
votes
2 answers
django-parler doesn't show tabs in admin
For some reason I'm not seeing any language tabs when adding to the admin. I'm using Django 1.9.10. I was using django-hvad but decided to try parler. I have tried the same exact code in a fresh project and it worked but in my existing project it…

fahadalmutairi
- 33
- 6
2
votes
2 answers
Making existing fields translatable(Django)
I am trying to translate already existing fields on a model class. I got stuck at the very first step, which is subclassing TranslatableModel class in Category, and adding TranslatedFields wrapper to translate selected model fields. I am following a…

an0o0nym
- 1,456
- 16
- 33
1
vote
1 answer
Django-parler: how to store and retrieve a translated model to/from more than one database?
I'm a big fan of Django-parler, but I've run into a problem when storing a translated model in two different databases.
My model is:
class InstrumentFamily(TranslatableModel):
primary_key = True
translations = TranslatedFields(
…

Alain Baudhuin
- 11
- 3