A mico-framework for collecting lightweight, non-crypto "signatures" for virtually anything.
Project description
Django Signoffs
A mico-framework for collecting lightweight, non-crypto "signatures" for virtually anything.
Signoff- a permitted user agrees to something at a time.Approval- a set ofSignoffsthat trigger a state change when theSigningOrderis complete.Approval Process- a sequence ofApprovalsthat drive a Finite State Machine.
Quick Start
-
Install the
django-signoffspackage from PyPI$ pip install django-signoffs
-
Add
signoffstoINSTALLED_APPS:INSTALLED_APPS = [ ..., "signoffs", ..., ]
Features
django-signoffs has 3 tiers. Import and use only the features you need...
signoffs.signoffs
A Signoff records that a user agreed to some statement at a time.
signoffs.signoffs provides a framework for defining use-cases
that fall within this broad requirement.
Core features:
AbstractSignetandAbstractRevokedSignetModels (persistence layer)- Base
SignoffTypes, with injectable business and presentation logic...SignoffLogic(permissions and buisness logic)SignoffFormsManagerandSignoffRenderer(presentation layer)SignoffUrlsManager(custom end-points)
- Signoff "forward" relation:
SignoffOneToOneField - Signoff "reverse" relation Manager:
SignoffSet(many-to-one) - Declarative signing order automation:
SigningOrder - Template tag:
{% render_signoff my_signoff %}
signoffs.approvals
An Approval records whether some condition was met at some point in time.
Essentially, it is a 2-state machine, designed to change states
when one or more Signoffs are completed, in some defined SigningOrder.
Core features:
AbstractApprovalSignetandAbstractApprovalStampModels (persistence layer)- Base
ApprovalTypes, with injectable business and presentation logic...ApprovalLogic(business logic)ApprovalStatusandApprovalRenderer(presentation layer)ApprovalUrlsManager(custom end-points)
- Approval "forward" relation:
ApprovalOneToOneField - Approval "reverse" relation Manager:
ApprovalSet(experimental) - Template tag:
{% render_approval my_approval %}
signoffs.process
An ApprovalsProcess defines a sequence of Approvals and the state changes and/or
side effects triggered by approving or revoking each of them.
Core Features:
ApprovalsProcess(a basic linear sequence ofApprovals)FsmApprovalsProcess(state-changes and sequencing defined bydjango-fsm)
Opt-in
Contrib Models
signoffs.contrib.signets
Signoffs core defines only abstract models, no migrations.
signoffs.contrib.signets provide concrete models that cover the basic use-cases. To opt-in, you must:
INSTALLED_APPS = [
...,
"signoffs.contrib.signets",
...,
]
$ python manage.py migrate signoffs_signets
Core Features:
- Concrete Models:
Signet, andRevokedSignetprovide persistence layer for - Concrete Signoffs:
SimpleSignoff,RevokableSignoff, andIrrevokableSignoff
signoffs.contrib.approvals
Approvals core defines only abstract models, no migrations.
signoffs.contrib.approvals provide concrete models with basic relations. To opt-in you must:
INSTALLED_APPS = [
...,
"signoffs.contrib.approvals",
...,
]
$ python manage.py migrate signoffs_approvals
Core Features:
- Concrete Models:
ApprovalSignet, andRevokedApprovalSignetdefine a FK relation to... Stampwhich provides persistence layer for...SimpleApprovalandIrrevokableApproval, which play nicely with...ApprovalSignoff, which uses the Concrete Models for persistence.
FsmApprovalsProcess
Signoffs is integrated with django-fsm, allowing approval processes to drive a finite state machine. To opt-in:
$ pip install django-signoffs[fsm]
Get Me Some of That
Check Out the Demo App
pip install -e git+https://github.com/powderflask/django-signoffs.git#egg=django-signoffspython django-signoffs/manage.py install_demopython django-signoffs/manage.py runserver
Acknowledgments
Special thanks to BC Hydro, Chartwell, and all Contributors
Technology Colophon
Without django and the django dev team, the universe would have fewer rainbows and ponies.
Signoffs approval process can be integrated on the deceptively clever django_fsm Friendly Finite State Machine.
Signoffs uses a global registry as store for singleton code objects - thanks persisting_theory!
This package was originally created with cookiecutter and the cookiecutter-pypackage project template.
For Developers
$ pip install -r reqirements_dev.txt
Tests
$ pytest
or
$ tox
Code Style / Linting
$ isort
$ black
$ flake8
Versioning
- Semantic Versioning
$ bumpver show
Docs
Build / Deploy Automation
- invoke
$ invoke -l
- GitHub Actions (see .github/workflows)
- GitHub Webhooks (see settings/hooks)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_signoffs-0.3.12.tar.gz.
File metadata
- Download URL: django_signoffs-0.3.12.tar.gz
- Upload date:
- Size: 96.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9244620dfa9502cfd791a10ba7a50f763d468a7fb3215b790a2bfb29e4d7e4e
|
|
| MD5 |
73329d99847402a312da89c8c12f5a6c
|
|
| BLAKE2b-256 |
f4a41a2df0b19cf8ba39eb57716bf1a0da3a8dfaa124aa07cab5b5defc8b14d4
|
Provenance
The following attestation bundles were made for django_signoffs-0.3.12.tar.gz:
Publisher:
release.yaml on powderflask/django-signoffs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_signoffs-0.3.12.tar.gz -
Subject digest:
f9244620dfa9502cfd791a10ba7a50f763d468a7fb3215b790a2bfb29e4d7e4e - Sigstore transparency entry: 150642131
- Sigstore integration time:
-
Permalink:
powderflask/django-signoffs@02bebb46b7c23cf75cc59d015bc052c8bc466795 -
Branch / Tag:
refs/tags/0.3.12 - Owner: https://github.com/powderflask
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@02bebb46b7c23cf75cc59d015bc052c8bc466795 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_signoffs-0.3.12-py3-none-any.whl.
File metadata
- Download URL: django_signoffs-0.3.12-py3-none-any.whl
- Upload date:
- Size: 109.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7528d0c4fb4bb829c97dc550c2593fb194ea0327538459494bc07fbbd260d5c
|
|
| MD5 |
365cb8880c7dbf9c34d7245de04bd22e
|
|
| BLAKE2b-256 |
145020cd056e259a24189dceeb3d4c2aed628aaf2ae32d659cf07a502c96348c
|
Provenance
The following attestation bundles were made for django_signoffs-0.3.12-py3-none-any.whl:
Publisher:
release.yaml on powderflask/django-signoffs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_signoffs-0.3.12-py3-none-any.whl -
Subject digest:
c7528d0c4fb4bb829c97dc550c2593fb194ea0327538459494bc07fbbd260d5c - Sigstore transparency entry: 150642132
- Sigstore integration time:
-
Permalink:
powderflask/django-signoffs@02bebb46b7c23cf75cc59d015bc052c8bc466795 -
Branch / Tag:
refs/tags/0.3.12 - Owner: https://github.com/powderflask
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@02bebb46b7c23cf75cc59d015bc052c8bc466795 -
Trigger Event:
push
-
Statement type: