Opened 22 months ago

Last modified 22 months ago

#34292 closed New feature

Support display function in InlineModelAdmin — at Version 1

Reported by: Al Mahdi Owned by: nobody
Component: contrib.admin Version: 4.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Al Mahdi)

InlineModelAdmin doesn't support display function

from django.contrib import admin

class SaleInline(admin.TabularInline):
    model = Sale

    @admin.display(description="Price")
    def cost(self, sale):
        return sale.price - sale.discount

    fields = ("product", "count", "cost")

FieldError

Unknown field(s) (cost) specified for Sale

Change History (1)

comment:1 by Al Mahdi, 22 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top