Skip to main content

Module for auto-naming unique constraint.

Project description

django-suc spares you from manually assigning a unique name to a constraint

Installation

You can install django-suc by using pip:

$ pip install django-suc

Quickstart

In your apps.py:

from django_suc import SmartAppConfig

class MyAppConfig(SmartAppConfig):
    ...

In your models.py:

from django.db import models
from django_suc import SmartUniqueConstraint

class MyClass(models.Model):
    ...
    class Meta:
        constraints = [
            SmartUniqueConstraint(fields=['field1', 'field2']),
        ]

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-suc-0.0.4.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

django_suc-0.0.4-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

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