Django Complex System Models
A Django app that helps you creating models within a Complex System.
License
Software licensed under MPL 2.0 license.
Installation
pip install django-cs-models
Usage
Two parameters have to be set in your settings. Here is an example:
COMPLEX_APP_NAME = 'ecosystem'
COMPLEX_STRUCTURE = {
'roots': [
['Organization', 'Committee', 'Board', 'Cohort'],
],
'nodes': [
['ProjectTeam'],
['Resource'],
['Member'],
]
}
Roots are entities that contain nodes (a root cannot contain another root). Nodes are entities contained by and containing other nodes.
You can define roots and nodes at different levels, i.e. their position in the hierarchy. These levels will tell if such entity can be contained by such other entity.
Now in ecosystem app:
from csmodels.models import abstract_model
class Cohort(abstract_model('Cohort')):
your_model_fields_here = models.SomeField()
class Meta:
verbose_name = _('Cohort')
verbose_name_plural = _('Cohorts')
The cohort model will inherit many to many relationships to project teams, resources and members from the abstract model.
Of course, a change in the complex structure will change the models, therefore migrations will be needed!
First diagram shows the example above.
Second diagram shows how links are created between entity depending on their type (root or node) and their level. Letters (their names) are not important, but numbers (their levels) are.
Documentation
Development
To run all the tests: tox
Changelog
0.1.0 (2016-10-06)
Alpha release on PyPI.
Release files for django-cs-models 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-cs-models-1.0.0.tar.gz | 20.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_cs_models-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size:27.0 kB
Release files / django-cs-models-1.0.0.tar.gz
| Download URL | django-cs-models-1.0.0.tar.gz |
|---|---|
| Size | 20.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6735571a7c4058a405cf50242a6a94d8a415eaf6b948cdff6d36c22ccaac6e28
|
|
BLAKE2b-256 checksum How to use checksums |
b22fd4903df8dbe39a9ff7fbad87ed543a8f9af2aafe1d92b184116f4369e9e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_cs_models-1.0.0-py2.py3-none-any.whl
| Download URL | django_cs_models-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
309c2c8881510748a48edd82b92270086111e971a9025f8d12f15979941e4f5a
|
|
BLAKE2b-256 checksum How to use checksums |
91719c4915d93886bd780a2153898cc7dcb37d6a5130a876a4253285948f93fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |