Skip to content

Commit

Permalink
Added methods to retrieve parent and child edges of a given node.
Browse files Browse the repository at this point in the history
  • Loading branch information
JackAtOmenApps committed Nov 24, 2020
1 parent bc4e488 commit f83d7b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions django_postgresql_dag/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,20 @@ def clan_edges(self):
"""
return self.ancestors_edges() | self.descendants_edges()

def parent_edges(self):
return edge_model.objects.filter(
child__in=[
self,
],
)

def child_edges(self):
return edge_model.objects.filter(
parent__in=[
self,
],
)

@staticmethod
def circular_checker(parent, child):
if child in parent.self_and_ancestors():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from setuptools import setup

version = '0.1.4'
version = '0.1.5'

classifiers = [
"Development Status :: 3 - Alpha",
Expand Down

0 comments on commit f83d7b4

Please sign in to comment.