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

Uploaded Source

Built Distribution

django_citext-1.0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_citext-1.0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for django_citext-1.0.2.tar.gz
Algorithm Hash digest
SHA256 375a2d6a06133ad9e375f0db62d4d606fa43428de14751d03856b9c702c0000f
MD5 f731e2d5b12d12d99febf8d91dbf91e5
BLAKE2b-256 e19badbf990e70b4187b97428114a355684a693177506167e1d99499391264f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_citext-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6ae71eb36442a61f1b2df5355c8ead9722b283a7b726cdfabcf0ff873a6b7613
MD5 fbe04b2da2bcd4ca26ebb8e6a704fd06
BLAKE2b-256 f25db65566a8b514441540b6a9c9ebaa39da7d5c9e2609d3d155bbf457abe4a7

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