Can you achieve a case insensitive 'unique' constraint in Sqlite3 (with Django)?

前端 未结 2 1176
离开以前
离开以前 2021-02-08 01:41

So let\'s say I\'m using Python 2.5\'s built-in default sqlite3 and I have a Django model class with the following code:

class SomeEntity(models.Model):
    some         


        
2条回答
  •  广开言路
    2021-02-08 02:25

    Perhaps you can create and use a custom model field; it would be a subclass of CharField but providing a db_type method returning "text collate nocase"

提交回复
热议问题