2017-02-11 20:16:35 +08:00
|
|
|
from django.db.models import CharField, EmailField, TextField
|
2016-06-02 05:43:59 +08:00
|
|
|
|
2017-02-11 20:16:35 +08:00
|
|
|
__all__ = ['CICharField', 'CIEmailField', 'CIText', 'CITextField']
|
2016-06-02 05:43:59 +08:00
|
|
|
|
|
|
|
|
2017-02-11 20:16:35 +08:00
|
|
|
class CIText:
|
2016-06-02 05:43:59 +08:00
|
|
|
def db_type(self, connection):
|
|
|
|
return 'citext'
|
2017-02-11 20:16:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
class CICharField(CIText, CharField):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class CIEmailField(CIText, EmailField):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class CITextField(CIText, TextField):
|
|
|
|
pass
|