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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_citext-0.1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_citext-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 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.2.tar.gz
Algorithm Hash digest
SHA256 8481da59901f00e7df1c4af0f4cacbe63729098d4628abafda3cd8eefec303dd
MD5 d8ae7b331e535d7e4bab17ceafd2d474
BLAKE2b-256 1ac564b9b92438f09cdcb103af82a0d454de1acd056e3c7c071c9125f931a7cf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for django_citext-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d673e6c672486fa113d0eaa96878d13efbbb7fb04cf860a9667d5db93ec8877a
MD5 f2086a6d613a338b8c8cb845553d753a
BLAKE2b-256 354a05452f3b2a30b0c7b2b5536326fe190d8aba2faa518b82f6cc1ac9a8197b

See more details on using hashes here.

Supported by

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