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

Uploaded Source

Built Distribution

django_citext-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django_citext-0.1.1.tar.gz
Algorithm Hash digest
SHA256 04e82d9ef976a13edf1abbf4fb37aa41bbf78e7964a29e81051a27ee5352c4e6
MD5 1263911486b3c4d9a2ce54262fd6aa9f
BLAKE2b-256 3b6dcd9879b8e34d655c508e9759b8e1d0f9916fe2ee625819d04c4c548d44da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_citext-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b2b3be37a7c477666ddae3a51a202b97d9bcd5687c60af6901be1fea558f5c8
MD5 99723fe3d1369510949355de41f59cd9
BLAKE2b-256 79d4725bb4ab618317a223d153e891c019bbfa826880dd6a9c57c65edb466c9a

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