bio2bel / expasy

A Bio2BEL package for converting ExPASy to BEL
MIT License
0 stars 0 forks source link

Use a SQLAlchemy relationship for children #13

Closed cthoyt closed 6 years ago

cthoyt commented 6 years ago

The query in this function should be directly accessible by defining a relationship variable called children in bio2bel_expasy.models.Enzyme such that the function

https://github.com/bio2bel/ec/blob/fda63d0ef09f72fcfa1fb93c6f6fc317886b01c3/src/bio2bel_expasy/database.py#L209-L216

can be implemented as simply as

def get_children(self, expasy_id):
    """"Gets the children of an enzyme by its identifier

    :type str expasy_id: An expasy database identifier
    :rtype: list[Enzyme]
    """"
    enzyme = self.get_enzyme_by_id(expasy_id)
    return enzyme.children
aramgrigoryan commented 6 years ago

not needed for now