django-mindscape
(todo: gentle introduction)
(todo: add information about use case)
features
collecting information about dependencies of models (model -> parent)
collecting information about reverse dependencies of models (model -> [children])
listing model with dependencies-considered order.
(dependencies-considered order means, when i < j, models[i] doesn’t depends on models[j])
how to use
from django_mindscape import ModelMapProvider, Walker, Brain
from django.apps import apps
walker = Walker(apps.get_models(), brain=Brain())
p = ModelMapProvider(walker)
"""
when ParentModel : YourModel = 1 : N
and OtherModel is existed.
"""
# model dependencies (bottom up)
for relation in p.dependencies[YourModel].dependencies:
print(relation.from_.model) # <YourModel>
print(relation.to.model) # <ParentModel>
print(relation.type) # relation type (candidates: 11, 1M, MM)
# reverse dependencies (top down)
for rnode in p.reverse_dependencies[ParentModel].dependencies:
print(rnode.node.model) # <YourModel>
# clustered model list
for cluster in p.cluster_models: # [[ParentModel, YourModel], [OtherModel]]
for model in cluster:
print(model)
# ordered model list
for model in p.ordered_models: # [ParentModel, YourModel, OtherModel]
print(model)
Metadata
Release files for django-mindscape 0.3.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 | Provenance | Actions |
|---|---|---|---|---|
| django-mindscape-0.3.0.tar.gz | 7.1 kB | Without provenance | Details for django-mindscape-0.3.0.tar.gz |
Release files / django-mindscape-0.3.0.tar.gz
| Download URL | django-mindscape-0.3.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d9606e91db131c53efbe0bf13b91d0debdfcde447f26ae484a1ed3d40c46f4b
|
|
BLAKE2b-256 checksum How to use checksums |
5d74abe1a5716922feaab61d59d592c6cfe011c3bdebfcb2cf4abac3b3d69d5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-mindscape 0.3.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.