You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

citext.py 439B

123456789101112131415161718192021222324
  1. from django.db.models import CharField, EmailField, TextField
  2. __all__ = ['CICharField', 'CIEmailField', 'CIText', 'CITextField']
  3. class CIText:
  4. def get_internal_type(self):
  5. return 'CI' + super().get_internal_type()
  6. def db_type(self, connection):
  7. return 'citext'
  8. class CICharField(CIText, CharField):
  9. pass
  10. class CIEmailField(CIText, EmailField):
  11. pass
  12. class CITextField(CIText, TextField):
  13. pass