Ever wondered what happens if you store your Python classes directly in your database? (And no, we’re not talking about pickling)
When faced with the problem of modelling a large, complex type hierarchy of "stuff one might find in a seven bedroom home", we went down the somewhat unusual route of storing not only the objects themselves, but also their types in a graph database.
In this talk we will take a look under the hood of Kaiso, the open source framework we built to do this, and how we use some metaclass magic to to make it all happen.
Unlike conventional ORMs, we needed the schemas to be as dynamic as the records, and so decided to keep them side by side in our neo4j db. Using the Python type system as our data model means we get features like hierarchy consistency checks and other type calculations for free.
While this might not be the solution to a particularly common problem, come along to see how we’ve used some of the more dynamic aspects of the Python language for fun and profit!