Source code django/contrib/postgres/fields/citext.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from django.db.models import CharField, EmailField, TextField

__all__ = ['CICharField', 'CIEmailField', 'CIText', 'CITextField']


class CIText:

    def get_internal_type(self):
        return 'CI' + super().get_internal_type()

    def db_type(self, connection):
        return 'citext'


class CICharField(CIText, CharField):
    pass


class CIEmailField(CIText, EmailField):
    pass


class CITextField(CIText, TextField):
    pass