On Oct 14, 9:08 pm, Paul Johnston <[EMAIL PROTECTED]> wrote:
> I've had a go at updating the SQLAlchemy docs to the current state of play.
>
> http://docs.turbogears.org/1.0/RoughDocs/SQLAlchemy
>
> I'll wait a few days for comments, then promote this to being the main
> document.

Hi Paul,

Here are a few comments, coming from someone who's just trying to
start up a new TG app using SQLAlchemy for the first time.

"The Elixir approach usually results in shorter code. Some advanced
functionality cannot be achieved using Elixir, and plain SA must be
used. Despite this, Elixir is recommended for new projects."  It
essentially warns you that Elixir stops you from doing some things,
but doesn't tell you what. Why recommend a method that limits you?
There must therefore surely be significant benefits to the Elixir
method, and I think they need briefly summarising here. Similarly, I
think it's essential that there's a quick overview of the things that
Elixir cannot handle, otherwise you risk encouraging people to make a
wrong decision at this point that may or may not be easy to rectify
later. (And indeed, how easy such a change is to make is another piece
of info that should probably be here.)

"Now change the value of sqlalchemy.dburi to point to a valid database
connection." You might want to specify the file that this is done in,
for completeness.

"Plain SA with scoped_session. Use turbogears.database.session.mapper
as the mapper:" ... why does this syntax differ from the example
syntax given to you in a quick-started SA project, which uses
sqlalchemy.orm.mapper instead? This has now made me worry that I'm
doing things the wrong way. :)  If there's a difference, or even if
they're identical, I think this needs to be made clear.

It also doesn't give much detail on how to define the model. Even
ignoring the mapper, the format for defining columns is significantly
different from that used in GettingStarted/DefineDatabase, so a user
would have to search elsewhere for it. One thing I'm personally
struggling with now I'm using SQLAlchemy is how to define
relationships between tables; it seems quite possible to accidentally
define one-to-many relationships on both tables when you use backrefs,
for example.

Hope that helps.
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