You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have setted everything according to docs and I have nearly 40 i18n languages setted up, with 2 fields marked for translation, as per docs. Now if I open up admin panel to get details of a perticular object it will display, 40x2=80 fields which is disastrous to load, it took nealy 2 mins and caused around 4000 sql queries for me. 😢 .
here is how my setup looks like: admin.py
from django.contrib import admin
from api.models import *
from modeltranslation.admin import TranslationAdmin
# Register your models here.
@admin.register(Application)
class ApplicationAdmin(admin.ModelAdmin):
list_per_page = 50
for translation.py
from modeltranslation.translator import register, TranslationOptions
from api.models import Application, WhatsNew
@register(Application)
class AppDataTranslationOptions(TranslationOptions):
fields = ('description', 'description_short',)
So the question is, is it possible to display translation fields only the currently activated langauge, for example here is a field description, and activated language being /de/, can we display only that field (description_de) in admin panel?
The text was updated successfully, but these errors were encountered:
kirmola
changed the title
Is it possible to get the fields relevent to current language in admin panel?
Is it possible to display only those fields which are relevent to current language in admin panel?
Feb 2, 2025
I have setted everything according to docs and I have nearly 40 i18n languages setted up, with 2 fields marked for translation, as per docs. Now if I open up admin panel to get details of a perticular object it will display, 40x2=80 fields which is disastrous to load, it took nealy 2 mins and caused around 4000 sql queries for me. 😢 .
here is how my setup looks like:
admin.py
for
translation.py
So the question is, is it possible to display translation fields only the currently activated langauge, for example here is a field description, and activated language being
/de/
, can we display only that field (description_de
) in admin panel?The text was updated successfully, but these errors were encountered: