Skip to main content

Installation

$ [sudo] pip install django-postgres-model-constraints

Pros

designed for Django projects with a large number of models:

  • no need makemigrations and migrate
  • no migration conflicts
  • integrity checks - drop and create constraints again
  • define tables with raw SQL (optional)

Examples

from django.apps import apps
from django_postgres_model_constraints.utils import get_add_foreign_key_constraint_statements, get_add_unique_constraint_statements


for model in apps.get_models():
    statements = get_add_unique_constraint_statements(
        model) + get_add_foreign_key_constraint_statements(model)
from django.apps import apps
from django_postgres_model_constraints.utils import get_drop_foreign_key_constraint_statements, get_drop_unique_constraint_statements


for model in apps.get_models():
    statements = get_drop_foreign_key_constraint_statements(
        model) + get_drop_unique_constraint_statements(model)

readme42.com

Metadata

Release files for django-postgres-model-constraints 2020.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-postgres-model-constraints 2020.7.1
File Size Uploaded
django-postgres-model-constraints-2020.7.1.tar.gz 3.0 kB Details

Release files / django-postgres-model-constraints-2020.7.1.tar.gz

Download URL django-postgres-model-constraints-2020.7.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0b4039a81984281bb1c974a33ab70d839e54510ab8cca8ddac81efe698ccf97c
BLAKE2b-256 checksum
How to use checksums
a98bf15467b05ccca57b26f58500cc19ea7d141eee692276cb56c66e2ddd4464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.7

Release history Release notifications | RSS feed

This release

2020.7.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page