Hi Specklers,
I’m currently building a speckle connector for one of our in-house webapps. Thanks to this great tutorial I’ve been able to authenticate and now I’m at the point I’m going to serialize the objects to Speckle objects and send them to the speckle.xyz server.
The situation is as follows: I have a Django web-app and I’m using the specklepy client to send the data to the server with the token from the authentication workflow of the tutorial. The objects I’m trying to send are “Django-models” from PostgreSQL DB for which I’ve used a speckle class factory which automatically converts the “Django-models” to SpeckleClasses.
Within the serialization logic I’m using I’m able to convert all objects automatically to speckle objects, but I’m foreseeing issues when I would like to use the relations between the obects within the Speckle server.
Below you can find the DB-model where the issue occurs.
So I can keep the relations between the objects: FacilityCalculation > FacilityDesignOption > Facility > YearlyFacility. But the “horizontal relation” between “YearlyTrafficSector” and “YearlyFacility” would cause issues when serializing because it would duplicate the objects.
I’m trying to find a way to do this properly, and was wondering what the “Speckle” way of sending these kind of objects would be? It would be great if you could access “YearlyFacility” through: YearlyTrafficSector, Year and Facility for example without duplicating the YearlyFacility Obj three times, just like I can do with my Django ORM.
Thanks for reading and happy to explain more if unclear.
Cheers, Dirk