Questions tagged [django-parler]

Simple Django model translation

40 questions
1
vote
1 answer

Django - How to query a related translated model?

I have two models that are many to many related. Article and Tag models. Both are TranslateableModel using django-parler. models.py class Article(BaseModelMixin, TranslatableModel): translations = TranslatedFields( …
moddayjob
  • 606
  • 5
  • 17
1
vote
0 answers

Why can't I create an instance of a class inside an abstract class

I am using django-parler for language translation in an abstract class model but I get this error: raise TypeError("Can't create TranslatedFieldsModel for abstract class {0}".format(shared_model.__name__)) TypeError: Can't create…
1
vote
1 answer

django-rest-framework-datatables and Django Parler's translation field

I've got model with translated fields. class Device(TranslatableModel): translations = TranslatedFields(name=models.CharField(max_length=100)) I made a serializer like: class DeviceSerializer(TranslatableModelSerializer): translations =…
1
vote
1 answer

Django-parler: type object 'BookImage' has no attribute '_parler_meta'

This error is raised by django-parler when I'm trying to add a new Book using django admin interface. models.py from django.db import models from django.urls import reverse from isbn_field import ISBNField from django.core.validators import…
user9307199
1
vote
1 answer

Django Parler how to access translated model field from a mixin

I have written this model. class Course(TranslatableModel): translations = TranslatedFields( title = models.CharField(max_length=200), overview = models.TextField(), slug = models.SlugField(max_length=200, unique=True)) …
Paddy Popeye
  • 1,634
  • 1
  • 16
  • 29
1
vote
1 answer

Django: How to create a multilingual website

I wanto create a multilingual website in Django and I tried using django-parler but when I want to add an object by the admin, the admin doesn't show the translatedfield Here is a part of my models: class Movie(TranslatableModel): translations…
1
vote
2 answers

What the right way to localize the price in the Django-shop?

I know easy way, make a few different fields for needed currencies, but that's not only ugly, but the currencies will be hardcoded. It seems to me be more elegant through django-parler, but I do not quite understand how to do it.
Atterratio
  • 445
  • 2
  • 9
  • 25
1
vote
1 answer

Django Admin how to change text in relations field

I have the following code: models.py from django.db import models from parler.models import TranslatableModel, TranslatedFields class Federation(TranslatableModel): translations = TranslatedFields( name = models.CharField('name',…
Gasim
  • 7,615
  • 14
  • 64
  • 131
0
votes
1 answer

How to localize django-filter labels using django-parler

I am developing an e-commerce website and I am using django-filter to filter products by size, category, color, price. However I can't find a way to translate labels for filters using django-parler, I managed to translate choices for ascending and…
0
votes
2 answers

Django parler: error when same translation for different languages

EDIT: my bad, i had: translations = TranslatedFields( title=models.CharField(_('Title'), unique=False, max_length=40, null=False, blank=False) ) I had unique=True, that was the reason, so now the question is how do I require unique title for…
0
votes
1 answer

How save edit form in multilanguage project

I'm studying Django from the book Django 2 by Examples. I'm trying to improve a project which starts in chapter 10. Now, I'm trying to add multilingualism with the help of "django-parler". In general I did it, but it seems to me that there are…
0
votes
1 answer

Translations tabs of Django parler not showing in the view

I'm using django parler to translate my models. now i'm creating a custom admin Panel and i have a view for create and update of Contents. I'm using a class based view inherit from "View" for both create and update views so i can't use the…
0
votes
1 answer

Django translations with parler - show default language text when adding translation

I'm working on a Django CMS with content to be translated into multiple languages. I'm using django-parler. To make the translations easier I would like to have the text from the default language visible when adding the translated text, preferable…
Erik S
  • 502
  • 3
  • 11
0
votes
0 answers

ImportError: cannot import name 'BoundField' from 'django.forms.forms'

I am having ImportError: cannot import name 'BoundField' from 'django.forms.forms' I was facing ImportError: cannot import name 'pretty_name' from 'django.forms.forms' then I changed: from django.forms.forms import pretty_name to from…
Kamronbek
  • 1
  • 1
0
votes
1 answer

Using translate field for 'unique' rises NameError, django-parler

I've recently installed django-parler==2.2 and when I rewrite my model to inherit from TranslatableModel and then try to makemigrations I get the following error: main_menu_slug = models.SlugField(max_length=120, unique=main_menu_item) NameError:…
kaktus_car
  • 986
  • 2
  • 11
  • 19