Answer the question
In order to leave comments, you need to log in
Django how to return a certain number of forms from a model?
Hello, how to return a certain number of forms from a model?
let's say when editing we have n - the number of added records, how to return, for example, only the last 3
class JurnalInline(admin.TabularInline):
model = Jurnal
extra = 1
class ClientAdmin(admin.ModelAdmin):
inlines = [JurnalInline]
Answer the question
In order to leave comments, you need to log in
Set sorting and limit quantity :
class JurnalInline(admin.TabularInline):
max_num = 3
ordering = ['-data_poseshenia']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question