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.


from django.db import models
from django_postgres_unlimited_varchar import UnlimitedCharField

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


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.

Files for django-postgres-unlimited-varchar, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django_postgres_unlimited_varchar-1.1.0-py3-none-any.whl (1.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-postgres-unlimited-varchar-1.1.0.tar.gz (1.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page