📅  最后修改于: 2022-03-11 14:58:54.308000             🧑  作者: Mango
def get_readonly_fields(self, request, obj=None):
if obj: # obj is not None, so this is an edit
return ['third_party_id',] # Return a list or tuple of readonly fields' names
else: # This is an addition
return []