Django Admin list_editable save 호출 함수

2021. 2. 10. 14:31파이썬/Django

변경된 row  한개씩 처리

    def save_model(self,request,obj,form,change) :
        if(obj.lang != Image.objects.get(id=obj.id).lang) :
            train.createBox(obj)
        super(ImageAdmin,self).save_model(request,obj,form,change)

변경된 row 전체 처리

    def save_formset(self,request,form,formset,change) :
        print('save_formset')
        super(ImageAdmin,self).save_formset(request,form,formset,change)