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-1.0.2.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for django_citext-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ae71eb36442a61f1b2df5355c8ead9722b283a7b726cdfabcf0ff873a6b7613 |
|
MD5 | fbe04b2da2bcd4ca26ebb8e6a704fd06 |
|
BLAKE2b-256 | f25db65566a8b514441540b6a9c9ebaa39da7d5c9e2609d3d155bbf457abe4a7 |