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.2.0.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file django_citext-0.2.0.tar.gz
.
File metadata
- Download URL: django_citext-0.2.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cbd9b2b51134dfc20196998dc07183c3adabca0c99b579bbaad78da7e850e4a |
|
MD5 | 0da95a2a6b689cf31e6ae3612d5e2871 |
|
BLAKE2b-256 | 921bdb53a85f9b457693ddc64921a9326df9bca04a0bf94d7149403683b52266 |
File details
Details for the file django_citext-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_citext-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60c87e8719d594f177c5c44cd63e5af7bcc585657fab29be8d8c819f82edd350 |
|
MD5 | deea684c0a1ee7230bdc836ce59ad137 |
|
BLAKE2b-256 | 1007f1eca8a0c45af68046fbcd73307f11011da9a05c9fbfc4730faaff538ce0 |