>  Q&A  >  본문

python - Django Model 中的字段设置unique=True后,在更新时报错!

Serializer 设计如下:

ViewSet 设计如下:

调用AmUsersViewSet的update时, 并没有错误产生; 而调用 UserViewSet 的 update 时,就发生 “{u'amusers': OrderedDict([(u'openid', [u'AmUsers with this unionid already exists.'])])}” 错误! 都是在没有改动 openid 的情况下出现的。
PHP中文网PHP中文网2742일 전909

모든 응답(0)나는 대답할 것이다

답장 없음
  • 취소회신하다