django-children-models-dependencies provides tools to get the dependencies in a tree of django models
Project description
Purpose
This is a small app that allow to get the children of a base model, in an dependency order from the model with the less dependencies, to the model with the more dependencies, each model coming after its own dependencies
For example, for theses models:
class BaseModel(models.Model):
class Meta:
abstract = True
class ChildModel1(BaseModel):
pass
class ChildModel2(BaseModel):
link = models.ForeignKey('myapp.ChildModel3', on_delete=models.CASCADE)
class ChildModel3(BaseModel):
pass
The order will be:
from django_children_models_dependencies.manager import ChildrenDependenciesManager
self.assertListEqual(ChildrenDependenciesManager.get_children_dependencies(BaseModel), [
ChildModel1, # first model without dependencies
ChildModel3, # dependency of ChildModel2, so it comes before
ChildModel2, # last one, which must come after its own dependencies
])
Installation
Install from PyPI:
pip install django-children-models-dependencies
Requirements
Python 3.9, 3.10, 3.11, 3.12
Django 4.2, 5.0, 5.1
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_children_models_dependencies-1.2.1.tar.gz.
File metadata
- Download URL: django_children_models_dependencies-1.2.1.tar.gz
- Upload date:
- Size: 64.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdb6d705452bc1e818dfdf07f500a228344a5e655326048849c8c4e68466df72
|
|
| MD5 |
61ff2dee49b539a617bdda4a205f3b2b
|
|
| BLAKE2b-256 |
4f42201bf5c627458d578e820cded8d994a3e4acca70fb8e27cf9d07700a83d2
|
File details
Details for the file django_children_models_dependencies-1.2.1-py3-none-any.whl.
File metadata
- Download URL: django_children_models_dependencies-1.2.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e837e9ee52622e9673642bdffa31e441c327a7f0cc4dfcd89f177db20b9920df
|
|
| MD5 |
6502977b042fc0f86c29edf46ac1dec4
|
|
| BLAKE2b-256 |
a41078365a3136700a886c11a003423db4ba5d162e33346d2bcae878f5fd6938
|