On Mon, Jan 2, 2012 at 9:35 PM, Jonathan Vanasco <jonat...@findmeon.com> wrote:
> - I think SqlAlchemy is the best ORM out there, and it's honestly been
> the deciding factor for me going with Pylons and sticking with
> Pyramid.
> - I think Pyramid core really needs to have a concrete DB/ORM plugin
> functionality / method / api / style.  Whether you use SqlAlchemy or
> ZopeDB or something else, I think Pyramid should have a standard /
> recommended and documented place + support for starting up the DB
> connectivity.  This doesn't need to be lines of code , it could just
> be a very well documented coding style / paster template.
> - I think the SqlAlchemy support needs to handle one or more
> databases , and both declaritive and reflective styles ( is there a
> third kind )?

With the opposition to SQLAHelper, I'm tempted to just go back to meta modules.

# myapp/models/meta.py
Session = ...
engine = ...
Base = ...

The default style is whatever's in the 'alchemy' scaffold.

# myapp/models/__init__.py
DBSession = ...
Base = ...

I don't think there can be an "official" way to do multiple databases
because it depends heavily on the situation. The Akhet and SQLAHelper
manuals show a few ways to do it.

http://docs.pylonsproject.org/projects/akhet/en/latest/model_examples.html
http://readthedocs.org/docs/sqlahelper/en/latest/usage.html

Reflection is more difficult because you can't map classes to tables
until they've been reflected, and I'm not sure how it affects
declarative syntax. So some of the global code you have to put in an
init function, at minimum the table definitions and mapper calls, and
at maximum the entire declarative classes. Again the Akhet manual
discusses this.

PS. The online Akhet manual is messed up because it's showing an
unfinished development version (Akhet 2.0b1, which doesn't exist yet).
The page I linked to is unchanged from the stable version, but some of
the earlier pages are an incoherent mishmash.

-- 
Mike Orr <sluggos...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to