Beispiel #1
0
 def save_model(self, request, obj, form, change):
     # form为提交的表单数据,里面包括了所有数据,其中
     # 里面的initial里面为原始数据
     # obj为要修改的对象,每次修改要进行save()
     # request是请求对象.
     obj.save()
     generate_static_list_search_html.delay()
Beispiel #2
0
class GoodsCategoryModelAdmin(admin.ModelAdmin):
    list_per_page = 10
    def save_model(self, request, obj, form, change):
        print(obj)

        print(type(obj))

        obj.save()

    # 调用生成静态页面方法
    generate_static_list_search_html.delay()
Beispiel #3
0
 def save_model(self, request, obj, form, change):
     generate_static_list_search_html.delay()
Beispiel #4
0
 def delete_model(self, request, obj):
     generate_static_list_search_html.delay()
Beispiel #5
0
 def delete_model(self, request, obj):
     # 物理删除,逻辑删除的话可以obj.is_delete=Ture
     obj.delete()
     obj.save()
     generate_static_list_search_html.delay()