django admin:readonly_fields =' some_filed'但创建或添加不能编辑相同,这是一个好方法
答案 0 :(得分:0)
def get_readonly_fields(self, request, obj=None):
if obj is None:
return ()
return self.readonly_fields
(答案,根据问题评论django admin readonly_fields = 'some_field' but create or add cannot edit the same中原始发帖人@Ma_Mars)