citext 0.1.0

Creator: codyrutscher

Last updated:

Add to Cart

Description:

citext 0.1.0

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.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.