Skip to main content
https://travis-ci.org/matthiask/django-specifications.png?branch=master

This module offers an easy way to attach auxiliary information to Django models. It allows configuring custom forms through the administration interface.

Usage

  1. Add "specifications" to INSTALLED_APPS.

  2. Create a specification = ForeignKey("specifications.Specification") on the model you want to use specifications with. The foreign key can be nullable or required, as you wish.

  3. Create the place where the specification field data is actually stored:

    from specifications.models import SpecificationValueFieldBase
    
    class MyObjectField(SpecificationValueFieldBase):
        parent = models.ForeignKey(
            MyObject,
            on_delete=models.CASCADE,
            related_name="fields",
        )
    
        class Meta:
            ordering = ["field__group__ordering", "ordering"]
  4. Inherit from FormWithSpecification when creating your ModelForm:

    from specifications.forms import FormWithSpecification
    
    class MyObjectForm(FormWithSpecification):
        class Meta:
            model = MyObject
  5. If you want to edit models with specifications you might want to use the following snippet:

    from specifications.admin import ModelAdminWithSpecification
    
    class MyObjectAdmin(ModelAdminWithSpecification):
        pass

The fields are available after saving a specification. The specification can be changed, but you risk losing data if you do this.

Metadata

Release files for django-specifications 0.5.0

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-specifications 0.5.0
File Size Uploaded Provenance Actions
django_specifications-0.5.0.tar.gz 10.9 kB Without provenance Details for django_specifications-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-specifications 0.5.0
File Interpreter ABI Platform Actions
django_specifications-0.5.0-py3-none-any.whl Python 3 none any Details for django_specifications-0.5.0-py3-none-any.whl

Total release size: 23.9 kB

Release files / django_specifications-0.5.0.tar.gz

Download URL django_specifications-0.5.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
74c968304a508a23b9ea5f4c6eb837cfe8d492d8059c5a196f1d857b9b5c6423
BLAKE2b-256 checksum
How to use checksums
f601063582bd6b5b6c5141e365021745636cde7339b5df96eb56e16df6c724ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release files / django_specifications-0.5.0-py3-none-any.whl

Download URL django_specifications-0.5.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2568793bf709df37402d017b6675711a9cc08b928a0fa287877244a896b46486
BLAKE2b-256 checksum
How to use checksums
0ba8725caca328299f64a7c78757fb7415a5c9b4c64fe11ff335bdd621a3a3b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Security for django-specifications 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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