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

citext-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

citext-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file citext-0.1.0.tar.gz.

File metadata

  • Download URL: citext-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for citext-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6ff8cf2d98778e067b8211e5cc3379ed26fbfc74eb9b2f9b5dc4a4dc9591023a
MD5 6a8ea5be118b4d3fbf7db9f761fc6e10
BLAKE2b-256 fd6a47ac1d7b73fbcb2ca5e237d7e03cc8b1c2dbeda86043e525ab2a590a93a5

See more details on using hashes here.

File details

Details for the file citext-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: citext-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for citext-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9101da576bc6233081bbbe6caab46395294ac6c1966521483f76ee0ca2c32472
MD5 4855159af38f20b146be763f5a9ab0dd
BLAKE2b-256 bd1a5c7a7c57e9a3cc63438b5413f8f7285c16bb1dd96c462004f57e8f6bbc65

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