Case insensitive unique model fields in Django?

后端 未结 7 2079
我寻月下人不归
我寻月下人不归 2020-12-02 11:23

I have basically a username is unique (case insensitive), but the case matters when displaying as provided by the user.

I have the following requirements:

相关标签:
7条回答
  • 2020-12-02 11:48

    You can use lookup='iexact' in UniqueValidator on serializer, like this: Unique model field in Django and case sensitivity (postgres)

    0 讨论(0)
提交回复
热议问题