Answer the question
In order to leave comments, you need to log in
How to display inline filter in Django admin?
Hello, I have been working with django for quite some time now and I am interested in the following question.
Is it possible to display in list_filter by added inline?
Need to filter by executer_id
class Order(models.Model):
users_create = models.ForeignKey(User, on_delete=models.CASCADE)
date_create = models.DateTimeField()
date_work = models.DateField()
date_close = models.DateField()
class OrderExecuter(models.Model):
order_id = models.ForeignKey(Order, on_delete=models.CASCADE)
executer_id = models.ManyToManyField(User)
class OrderExecuterInline(admin.TabularInline):
model = OrderExecuter
extra = 1
max_num = 1
@admin.register(Order)
class Order(admin.ModelAdmin):
inlines = (OrderExecuterInline, )
list_filter = (?????)
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