我正在使用 GenerickStackedInline,它是 InlineModelAdmin 的一个子类,用于 ModelAdmin。当我覆盖 save_model 方法时......它没有被调用。
class LocatedItemStackedInline(generic.GenericStackedInline):
template = "admin/location_app/located_items/stacked.html"
model = LocatedItem
extra = 1
form = MyModelForm
raw_id_fields = ('location',)
def save_model(self, request, obj, form, change):
import ipdb;ipdb.set_trace()
super(LocatedItemStackedInline, self).save_model(request, obj, form, change)
def save_form(self, request, form, change):
import ipdb;ipdb.set_trace()
super(LocatedItemStackedInline, self).save_form(request, form, change)
所以,我错过了什么?
有什么线索吗?
问候