aha, ok, thanks, but I saw it in the docs, ist it deprecated?  Then I
´m in a spot

I have a pool of tables and class in different files, When I start a
new application, all I want to do is for example:

from mymodels import Addresses
from mymodels import import users

and so on to select the types of tables I would want to use for the
application

in this pool, I cannot code the tables with a metadata beforehand
because it has to be created first

meta = DynamicMetaData()

users = Table("users",meta
    Column("id",            Integer,        primary_key=True),
    Column("username",      String(255),    unique=True,
nullable=False)
)

If I go the route of creating meta first I would have to create it in
every table file, in users.py, addresses.py e.tc. I tried using a file
called _initmodels.py and created the metadata only once and made alle
the separate table files import from it, but that ultimately failed
because when I imported it in websetup.py in pylons so I can use it to
setup my databses and app, it did not find the metadata properly, it
assumed it was another metadata, and naturally, no dtabases were
created

What should be used in this case?

thanks





On Jun 13, 3:11 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Jun 13, 2007, at 7:54 AM, voltron wrote:
>
>
>
> > I have decided to use the global_metada to setup the tables in my app,
> > in one of the tables, users, I setup an admin account
>
> > user = User("john doe", "[EMAIL PROTECTED]")
>
> > how do I flush the the above object? user.flush() does not work in
> > this context because the User object does not have the attribute
> > "flush" ( traceback)
>
> first of all, global_metadata is being removed in version 0.4.   not
> to mention, being able to say user.flush() (which only occurs now
> when you use assignmapper).  global_metadata is hardcoded to the
> "dynamicmetadata" which is an object most people shouldnt be using.
> shortcuts to configuration like that lead to people not understanding
> very well what they're doing.
>
> but beyond that, global_metadata has nothing to do with the object
> relational mapper.  you would still have to create an explicit
> session with the example code above, in which to save your User object.


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

Reply via email to