Answer the question
In order to leave comments, you need to log in
How to edit entities referencing element from TabularInline in Django admin?
There is an admin page for the car entity. On the same page, you can add and edit the Machine Dimensions entity. Here's what it looks like in the admin.py file:
class CarVolumeInline(admin.TabularInline):
model = CarVolume
template = "admin/vans/volumesTabularTemplate.html"
min_num = 0
max_num = 20
extra = 1
def get_queryset(self, request):
qs = super().get_queryset(request)
qs.hello = "Hellooo"
return qs
class CarAdmin(TranslationAdmin):
inlines = [CarVolumeInline] # таблица с размерами автомобиля
list_display = ('full_title', 'seo_set', 'slug')
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question