Sorry to ask what must be a fairly common question, but I don't see a
common answer anywhere yet!

I found writing out the model using the SQLAlchemy method reasonably
unpleasant, for 2 reasons: firstly, because of the unintuitive backref
stuff which seemed to allow a reference to be accidentally declared
twice under different names, and secondly because it specifies the
relationship values separately from the property values - this makes
reading the model.py to understand the model quite unintuitive.

So I redid it in Elixir and it looks far more palatable, with my
objects having all their data in the same place and without any
extraneous mapping stuff. All, that is, apart from the auto-generated
Identity tables which were plain SA and which I didn't feel confident
enough to alter.

My questions are these:

 - Generally responses have been along the lines of "you can use plain
SA with Elixir", but can someone be more specific on how this is done?
Can I refer to a plain SA class from Elixir and have it work, or vice
versa? Is it more effort than just picking one of the two?

 - Specifically, am I going to have problems with the Identity stuff
being in SA and the rest of my model being in Elixir? One or two of my
Elixir objects will need to access one or two of the plain SA models,
for certain.

 - People talk of there being things you can't practically do with
Elixir, but are quite vague on what this entails. Are these Turbogears
specific things or just object-relational specific things? I read that
the explicit mapping syntax of plain SA allows for mapping arbitrary
queries such as joins and so on, although at a glance it's not at all
obvious how. And docs.turbogears.org/1.0/SQLObjectVsSQLAlchemy
suggests that SO doesn't support multiple-column primary keys, but I
thought I read on this list recently that this isn't actually the
case. And I've no idea if Elixir supports them or not. So, just what
am I giving up by taking the simple approach?


I feel a bit stuck between using the easy and clean interface that
isn't recommended by TG, or using the complex and somewhat obscure
interface that is recommended by TG but nowhere near as well
documented as SQLObject used to be. My gut feeling is to bite the
bullet and switch it all to plain SA just to be on the safe side, but
it would be a shame to pull apart all those classes if it's ultimately
unnecessary.

It may be that I'm worrying for nothing and that changing from one to
the other later is simple, but then that would be useful information
to have as well. Hopefully there are answers to this and the other
questions.

Thanks,
Ben Sizer


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to