更新时间:2023-09-28 22:05:46
我需要在更新视图上覆盖 get_object()
方法,不要需要重写form_valid。自定义 get_object()
方法是:
I need to override the get_object()
method on the update view and do not need to override form_valid. The custom get_object()
method is:
def get_object(self, queryset=None):
return self.request.user