DAG in django
Project description
django-dagmodel
DAG in django
Free software: MIT license
Documentation: https://dag.readthedocs.io.
Installation
$ pip install django-dagmodel
or
$ python setup install
Usage
from dag import with_dag_node, with_dag_edge, with_dag
class MyJob(model.Model):
name = models.CharField(max_length=20)
class MyNode(with_dag_node('MyEdge', 'MyDag')):
name = models.CharField(max_length=10, unique=True)
def __str__(self):
return self.name
class MyEdge(with_dag_edge(MyNode)):
def __str__(self):
return f"{self.prev_node} -> {self.next_node}"
def __repr__(self):
return f"{self.prev_node} -> {self.next_node}"
class MyDag(with_dag(MyJob, 'MyEdge')): ...
>>> job = TestJob.objects.create(name='myjob')
>>> dag = MyDag.objects.create(job=job)
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2021-06-12)
First release on PyPI.
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
django-dagmodel-0.1.0.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for django_dagmodel-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 449a44b627d90919be9cb3a0c58bbc8b1c33860198228aa96fa45323016c4bb2 |
|
MD5 | 84fadb42322c43bc380efca8dfe925d8 |
|
BLAKE2b-256 | 69a3174e14310c6f95733d4052fb13e863f8ee91aafe5b22734a980773989274 |