PostgreSQL CITEXT integration for Django.
Project description
Django CITEXT
PostgreSQL CITEXT integration for Django.
Setup
python3 -m pip install django-citext
# settings.py
INSTALLED_APPS = [
'citext',
# ...
]
Usage
# myapp/models.py
from django.db import models
from citext import CITextField, CIEmailField
class MyModel(models.Model):
name = CITextField()
email = CIEmailField(unique=True)
# myapp/views.py
from django.http import HttpResponse, HttpResponseNotFound
from . import models
def my_view(request, email):
try:
my_model = models.MyModel.objects.get(email=email)
except models.MyModel.DoesNotExist:
return HttpResponseNotFound()
return HttpResponse(my_model.name)
Credits
Project is based on the Django's own CITEXT implementation, which was removed in Django 5.0. Big thanks to the Django contributors for their excellent work.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_citext-0.1.1.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file django_citext-0.1.1.tar.gz
.
File metadata
- Download URL: django_citext-0.1.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04e82d9ef976a13edf1abbf4fb37aa41bbf78e7964a29e81051a27ee5352c4e6 |
|
MD5 | 1263911486b3c4d9a2ce54262fd6aa9f |
|
BLAKE2b-256 | 3b6dcd9879b8e34d655c508e9759b8e1d0f9916fe2ee625819d04c4c548d44da |
File details
Details for the file django_citext-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: django_citext-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b2b3be37a7c477666ddae3a51a202b97d9bcd5687c60af6901be1fea558f5c8 |
|
MD5 | 99723fe3d1369510949355de41f59cd9 |
|
BLAKE2b-256 | 79d4725bb4ab618317a223d153e891c019bbfa826880dd6a9c57c65edb466c9a |