Skip to main content

A tiny app adding support unlimited varchar fields in Django/Postgres.

Project description

A tiny app adding support unlimited varchar fields (no specified max length) in Django/Postgres.

Usage:

from django.db import models
from django_postgres_unlimited_varchar import UnlimitedCharField

class Person(models.Model):
    name = UnlimitedCharField()
    ...

Why?

Out of the box, Django has two fields for text:

  • CharField, which is for single-line text, and has a required maximum length (the max_length argument). In the database, this creates a field of type varchar(LENGTH).

  • TextField, which is for multi-line text, and has no maximum length. In the database, this creates a field of type text.

Clearly missing is a third type: single-line, no max length. Postgres supports this as the varchar type (note the lack of a length).

This field adds that type. AFAIK there isn’t any performance hit in using this, so it’s suitable for any situation where there isn’t a clear required max length.

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-postgres-unlimited-varchar-1.0.1.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-postgres-unlimited-varchar-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django-postgres-unlimited-varchar-1.0.1.tar.gz
Algorithm Hash digest
SHA256 35730516441a7be3f10d16d3c76b126761cdffd4bfd8216e0bfc5557bde11154
MD5 bf086c065d1b26e4fa336802e0212331
BLAKE2b-256 90e0f30f0841ee6955800250967152c89e6414a864f9f19d1ad71fc6f0eb720c

See more details on using hashes here.

File details

Details for the file django_postgres_unlimited_varchar-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_postgres_unlimited_varchar-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a242fa5a8fb1fada40f0ba2cc12d37df8ee809a694fe698e38e2f9430efc5b31
MD5 e7ff200643c0960dc17ed7a3ab6210e4
BLAKE2b-256 a8fbbc9d6a8bcce32d34c9a777d6f624c0d7298630c0176c7d92170b04e169e0

See more details on using hashes here.

Supported by

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