Answer the question
In order to leave comments, you need to log in
Djnago parler does not return the translation?
admin.py:
products = Product.objects.filter(translations__title__contains=request.POST['text'])[:10]
return HttpResponse(serializers.serialize('json', products))
[{"model": "products.product", "pk": 2, "fields": {"alias": "Kran-so-shlangom", "category": 1, "status": true, "show_on_main": true, "discounts": true, "guarantee": true, "setting": true, "size": "", "uzs": null, "usd": null, "pricelist": ""}}]
Answer the question
In order to leave comments, you need to log in
Напишите свой сериализатор.
Гляньте как это организовано в django-parler-rest , и сделайте по образу и подобию.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question