[sqlalchemy] Re: New problem with synonym (getter/setter) use in 0.5.2

2009-02-04 Thread Michael Bayer
its not really a bug. use real column objects for your order by expression, i.e.: order_by=_username, this is because when using declarative, string arguments used in relation()/backref() where there are ordinarily class or SQL expression objects are interpreted to be part of the

[sqlalchemy] getting columns name from query result

2009-02-04 Thread maxi
Hi, Are there any approach to get columns names from query result ? I'm executing a dynamic sql statemet using text function and execute. s = 'select * from foo where foo.name like = :name' txt = text(s, bind=database.metadata.bind) p = {'name':u'some name'} result = txt.execute(p).fetchall()

[sqlalchemy] Re: Need SqlAlchemy Model Advice for a table with many foreign keys.

2009-02-04 Thread Gloria W
Thanks for this response. I do need all of the data available at once. Specifically, here is what I'm trying to do. I'm following this example right from the docs: from sqlalchemy import ForeignKey from sqlalchemy.orm import relation, backref class Address(Base): ... __tablename__ =

[sqlalchemy] Re: Need SqlAlchemy Model Advice for a table with many foreign keys.

2009-02-04 Thread GHZ
Don't know if this will work in your case.. but to handle joins to so many static tables. Note.. I didn't need to update these tables, nor query from them back to the data tables. (i.e. no need to call Gender.member_profiles()) I did something like the following: class MemberProfile(Base):

[sqlalchemy] Re: New problem with synonym (getter/setter) use in 0.5.2

2009-02-04 Thread Ken
On Feb 4, 6:53 am, Michael Bayer mike...@zzzcomputing.com wrote: its not really a bug.   use real column objects for your order by   expression, i.e.: order_by=_username, Oh, that makes sense. Thanks for the explanation. -Ken --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: Need SqlAlchemy Model Advice for a table with many foreign keys.

2009-02-04 Thread Gloria W
Excellent, thank you! Getting closer. I now use the same declarative_base on all instances, and I can now successfully refer to the relation() classes as actual class names instead of strings. During this query: memberProfile = session.query(MemberProfile).filter_by (memberID=81017).first() I

[sqlalchemy] Re: Need SqlAlchemy Model Advice for a table with many foreign keys.

2009-02-04 Thread Gloria W
Just to make it easier to read, I'm missing a FROM clause: sqlalchemy.exc.ProgrammingError: (ProgrammingError) missing FROM- clause entry for table member_profiles at character 5151 I read from the archive that this was a bug in 0.4. Thanks again, Gloria

[sqlalchemy] Getting a column's type from the column

2009-02-04 Thread PacSci
Hi. After working out my metadata issues (and scrapping four revisions and a Tomboy notepad of plans for my framework), I've realized that I am going to need something that is like FormAlchemy, but will convert models to a WTForms form instead. I've got the basis of the form field extraction code

[sqlalchemy] Re: getting columns name from query result

2009-02-04 Thread Randall Smith
maxi wrote: Hi, Are there any approach to get columns names from query result ? I'm executing a dynamic sql statemet using text function and execute. s = 'select * from foo where foo.name like = :name' txt = text(s, bind=database.metadata.bind) p = {'name':u'some name'} result =

[sqlalchemy] Re: Getting a column's type from the column

2009-02-04 Thread Randall Smith
PacSci wrote: Hi. After working out my metadata issues (and scrapping four revisions and a Tomboy notepad of plans for my framework), I've realized that I am going to need something that is like FormAlchemy, but will convert models to a WTForms form instead. I've got the basis of the form