roxeteer / django-pgfields

Django model fields for PostgreSQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django-pgfields

This is collection of Django model field subclasses that take advantage of PostgreSQL's column types.

CharField, EmailField, SlugField and URLField make the max_length argument optional, but otherwise work like the standard Django fields. When max_length isn't specified, the TEXT column type is used. See the PostgreSQL documentation for more on TEXT vs. VARCHAR.

UUIDField uses the UUID column type and is represented in Python as a uuid.UUID instance.

Usage

This package mimics GeoDjango by providing pgfields.db.models as a drop-in replacement for django.db.models. In the same style, pgfields.gis.db.models replaces django.contrib.gis.db.models.

from pgfields.db import models

class Person(models.Model):
    id = models.UUIDField("ID", primary_key=True)
    name = models.CharField("name")

About

Django model fields for PostgreSQL

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%