Django Admin 함수 오버라이딩

2021. 1. 31. 14:05파이썬/Django

get_queryset(self, request)를 super(ImageAdmin, self).get_queryset(request)로 변경하면 됨

@admin.register(Image)
class ImageAdmin(admin.ModelAdmin) :
    list_display = ['id','file']
    inlines = [BoxInline]

    def get_queryset(self, request):
        train.updateImage()
        return super(ImageAdmin, self).get_queryset(request)