Hello Wolfgang,
It's always nice to learn that a new pythoneer is among us :)
Sadly, I won't be able to immediatly answer your particular request.
Unfortunately, the support for compound primary keys has never been
finished. The code has been produced with multiple PKs in mind, however
it has never been tested, and I suspect it would require more than just
'testing it'.
I guess I should update the home page, stating that the framework is not
actively developped for the moment being. The lack of time on my side is
the main culprit. It is however stable, and running in 2 "live"
applications that are online for years and doing well --meaning: no bugs
have been triggered for a long period.
However, I won't spend time to develop new things alone on my own. Now,
if you find yourself interested enough and in the case you're eager to
look seriously at it, I mean the code, I'll be happy to help you in the
task.
If you're just looking for a object-relational bridge working "out of
the box" for your schemas involving compound PKs, I hate to say that but
frankly: I have to admit that you need to look elsewhere, because the
MDL framework does not support the feature you request right now.
Do not hesitate to ask if you need further details.
With my best regards,
-- Sébastien.
PS: In case you're curious, roughly said, two main things needs to be done:
1. being able to provide a generic way of supplying your own PKs values
when inserting new objects, cf.
DBContext.prepareForSaveWithCoordinator() calling
AdaptorChannel.primaryKeysForNewRowsWithEntity(), that's where we eed to
define a delegate for handling the cases where the PKs are not
automatically generated (that's true for simple PK btw)
2. testing that everything works okay with compound PKs: automatic
traversal of 1-1 & 1-to-many relationships, searching w/ paterns,
generation of complex SQL queries based on long KeyValuePath, updating
and deleting objects, etc. This is probably the more complex task,
since it requires a new schema for testing the features.
Wolfgang Keller a écrit :
> Hello,
>
> finally I got around to learn enough of Python to be able to start learning Modeling... :-)
>
> ...but the documentation (which is well done, btw.) says that Modeling doesn't support composite primary keys. X-( This would be a show-stopper for real-world applications in my case, as my datamodels (in fact they are not mine but "industry standards", because I'm too lazy to make my own ones ;-)) are all about "real world things" and thus for a reasonable identification schema surrogate keys are a no-no...
>
> TIA,
>
> Sincerely,
>
> Wolfgang Keller
>
|