Created
February 28, 2018 18:12
-
-
Save mekhami/46ba37aec84bf3645e6601e28b8eec52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@resource_op(("sample", "update", Sample)) | |
def add_sample_dependencies(sample, parents=None, children=None, return_dict=True, | |
session=None, agent=None): | |
""" | |
Add set of parent and or child dependencies to a given Sample. | |
""" | |
if parents is not None: | |
for p_uuid in parents: | |
sample = add_dependency(sample, p_uuid, label='begat', return_dict=return_dict, | |
session=session, agent=agent) | |
if children is not None: | |
for c_uuid in children: | |
sample = add_dependency(c_uuid, sample, label='begat', return_dict=return_dict, | |
session=session, agent=agent) | |
return sample |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment