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 ofSignoffs
that trigger a state change when theSigningOrder
is complete.Approval Process
- a sequence ofApprovals
that drive a Finite State Machine.
Quick Start
-
Install the
django-signoffs
package from PyPI$ pip install django-signoffs
-
Add
signoffs
toINSTALLED_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:
AbstractSignet
andAbstractRevokedSignet
Models (persistence layer)- Base
Signoff
Types, with injectable business and presentation logic...SignoffLogic
(permissions and buisness logic)SignoffFormsManager
andSignoffRenderer
(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:
AbstractApprovalSignet
andAbstractApprovalStamp
Models (persistence layer)- Base
Approval
Types, with injectable business and presentation logic...ApprovalLogic
(business logic)ApprovalStatus
andApprovalRenderer
(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
, andRevokedSignet
provide 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
, andRevokedApprovalSignet
define a FK relation to... Stamp
which provides persistence layer for...SimpleApproval
andIrrevokableApproval
, 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-signoffs
python django-signoffs/manage.py install_demo
python 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
File details
Details for the file django_signoffs-0.3.4.tar.gz
.
File metadata
- Download URL: django_signoffs-0.3.4.tar.gz
- Upload date:
- Size: 92.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5315590fd82020c246f1d40eba556b13fef5b7dea93f34d0adee5ad525e429ee |
|
MD5 | 0f748c572863358a0062dd6895e14da2 |
|
BLAKE2b-256 | 3b91921d51e8dce7d4c6f611a02ceb761fcdde1fa614f2cb912d6756cdf72e44 |
Provenance
File details
Details for the file django_signoffs-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: django_signoffs-0.3.4-py3-none-any.whl
- Upload date:
- Size: 106.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c13944378dced7c1acc3ce79fcc44cccf8562e2a4c4099e96960dcabbed473f4 |
|
MD5 | e4b44d73595aabf062df8c7f4dea3dc0 |
|
BLAKE2b-256 | e89e81819c567dd33c6121e99d09161c2d42cda93980d9aafd12f85f48e46949 |