I woke up today and decided it was time to switch one of my simpler
programs from sqlobject to sqlalchemy.

I'm using reflection.   After some googling I was able to find a way
to insert:
mp = mphones.insert().execute(word=word, mphone=phone)

The above works okay.

But I'd rather be able to do something like this:
mp = mphones(word=word, mphone=phone)
sess.add(mp)

Unfortunately I couldn't make that work.

Here's the setup code I'm using:
from sqlalchemy import *
from sqlalchemy.orm import sessionmaker

engine = create_engine("postgres://postgres:[redacted]/mydb")
meta = MetaData()
meta.bind = engine

Session = sessionmaker(bind=engine)
sess = Session()

mphones = Table('mphones', meta, autoload=True)

This is sqlalchemy 0.5 beta 3.

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