Skip to main content

PostgreSQL CIText integration for Django.

Project description

Django CIText

PostgreSQL CIText integration for Django.

PyPi Version Test Coverage GitHub License

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.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

django_citext-1.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file django_citext-1.0.0.tar.gz.

File metadata

  • Download URL: django_citext-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for django_citext-1.0.0.tar.gz
Algorithm Hash digest
SHA256 61f7ddcb9bbbb09bd405ae865f5fea453dff67780bbf99f4ff024f1f874c4219
MD5 2023a7b032154af006577a6aa267dbb8
BLAKE2b-256 809046caa36d7a2bdb74803563bc195e46d0535bb5c7e035d5e7715f4d00cac4

See more details on using hashes here.

File details

Details for the file django_citext-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_citext-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a53e780a7519a2129a5b30043dea05a3d99cfd5fa5493e0b09ee1b8a1cc1576
MD5 4061594eebe4b2ad59b56ff69f246218
BLAKE2b-256 359ff90d155ce2b9a84918f9a146eaec9a19d1503cef500277e0bb77f8580691

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page