Closed agnoam closed 7 months ago
Hey! Polymorphism (and inheritance in general) has fallen a bit short since I decided to add support for pydantic v2 (which actually took a lot more time than expected), but was actually planned from the beginning (and will definitely be added in the future).
The problem you are encountering is due to the fact that the validity of relationships is being checked by comparing the actual name of the class passed as a target model, rather than the labels defined for said model. This is also how models are currently resolved by the client. There are also some other known issues, for example the way settings should actually behave when inheriting from another class rather than overwriting everything. This will change in the future to use the labels/type defined for the model instead of the class name, but this comes with some refactoring, which in turn will need a lot of testing to make sure everything still works as expected.
I'm currently working on a new release and I might as well try and squeeze in said fixes, but I can't promise anything since I don't really have that much time to work on this project accept for the weekends (and maybe some evenings), but I will keep you posted on the progress.
Hey, just following up on this.
Version 0.5.0 has just been release which should have introduces polymorphism, together with a new migration cli. If you find any more bugs or have any feature requests, you are welcome to open up another issue! I am closing this issue now since it seems to be resolved.
Hey, I have tried to implement multiple classes that inherit one from another and tried to connect them by relationships. package version:
>=0.4.0
The example below:
I tried to connect a
CarNode
and aGasStationNode
with a basic relationship like the example below:The operation failed with an exception. Exception print: