On 8/16/07, Marco Mariani <[EMAIL PROTECTED]> wrote:
>
> Lukasz Szybalski ha scritto:
>
> > There is around 20 tables with a lot of foreign key, compound keys and
> > alternative keys.
> >
> > Which mapper do I use?
> >
>
> By mapper, do you mean a layer like ActiveMapper or Elixir?
What ever is recommended.  mapper, activemapper, assign_mapper,
elixir... I wouldn't know the difference between them so I'll use what
is recommended (mapper()).


> I am happy with the autoload feature. No need to declare the tables at all.
> Actually, I've never declared a table schema in python if not for
> testing purposes.
>
>
> tables = []
> for name in engine.execute("SHOW TABLES"):
>     tables[name] = sa.Table(name, metadata, autoload=True)
>


Here is my model.py
from sqlalchemy import *
from turbogears.database import metadata, session,bind_meta_data
from sqlalchemy.ext.assignmapper import assign_mapper
from sqlalchemy.ext.activemapper import *
from turbogears import widgets, validators


#Binding metadata to database
bind_meta_data()
#Table creation, from database
tables = []
for name in engine.execute("SHOW TABLES"):
    tables[name] = sa.Table(name, metadata, autoload=True)


I get an error

    for name in engine.execute("SHOW TABLES"):
AttributeError: 'module' object has no attribute 'execute'

--~--~---------~--~----~------------~-------~--~----~
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