Add an auto composer #5

Closed
opened 2023-01-15 07:31:52 +00:00 by Valbou · 0 comments
Valbou commented 2023-01-15 07:31:52 +00:00 (Migrated from github.com)

As many ORM, an attribute "object_id" refer to id and a "object" attibute to its composed instance.
This permit to decompose attribute name formatted like "anything_id" to find in Model.__subclasses__() if an "anything" class name exist.
If we find it and the dev explicitly demand it (in the model instance specific atribute), we can instantiate the class with a from_db call.

As many ORM, an attribute "object_id" refer to id and a "object" attibute to its composed instance. This permit to decompose attribute name formatted like "anything_id" to find in `Model.__subclasses__()` if an "anything" class name exist. If we find it and the dev explicitly demand it (in the model instance specific atribute), we can instantiate the class with a `from_db` call.
Sign in to join this conversation.
No description provided.