Directed Acyclic Graphs with a variety of methods for both Nodes and Edges, and multiple exports (NetworkX, Pandas, etc). This project is the foundation for a commercial product, so expect regular improvements. PR's and other contributions are welcomed.
The raw query generated by the Node are incompatible with Django Polymorphic because the .get_pk_name() method return the field name (e.g. parent_ptr) and not the field attribute name (e.g. parent_ptr_id).
Changing:
def get_pk_name(self):
"""Sometimes we set a field other than 'pk' for the primary key.
This method is used to get the correct primary key field name for the
model so that raw queries return the correct information."""
return self._meta.pk.name
to:
def get_pk_name(self):
"""Sometimes we set a field other than 'pk' for the primary key.
This method is used to get the correct primary key field name for the
model so that raw queries return the correct information."""
return self._meta.pk.attname
solve the problem.
The repo seems to not be up to date with the PyPi repo so I am hesitant to make a pull request.
The raw query generated by the Node are incompatible with Django Polymorphic because the
.get_pk_name()
method return the field name (e.g.parent_ptr
) and not the field attribute name (e.g.parent_ptr_id
).Changing:
to:
solve the problem.
The repo seems to not be up to date with the PyPi repo so I am hesitant to make a pull request.