So I'm making an API in a Django app and I have a class NodeID that follows the pattern:
class NodeID(enum.IntEnum):
EIGENVECTOR = 0
A simplified version of what I return in my view function is this:
return json.dumps({'eigenvector': NodeID.EIGENVECTOR})
When I view the result of my API in a browser, it shows the value of 'eigenvector' to be NodeID.EIGENVECTOR as opposed to the integer 0.
{"eigenvector": NodeID.EIGENVECTOR }
This makes it such that my front end can't handle it (it has no idea what NodeID is, obviously). How can I make it so that the call receives the value of NodeID.EIGENVECTOR instead of the variable?