[sqlalchemy] Using a non-string in sqlalchemy

2007-08-06 Thread malkarouri
Hi everyone, I am a newbie and I must be overlooking a simple thing here. But how do I typecast a string to the type needed by a mapped class, which is identified at run time? I have a class, class Record(object): pass which I map to one of different tables identified at run time. I get

[sqlalchemy] Re: Using a non-string in sqlalchemy

2007-08-06 Thread Jonathan Ellis
On 8/6/07, malkarouri [EMAIL PROTECTED] wrote: rec = Record() setattr(rec, col, val) This works if col is a string (the column subclassing SQLAlchemy's String) but not otherwise. I can identify the type of the column as I think most people just use a higher-level forms api. -Jonathan

[sqlalchemy] Re: Using a non-string in sqlalchemy

2007-08-06 Thread Michael Bayer
On Aug 6, 2007, at 8:29 AM, malkarouri wrote: Hi everyone, I am a newbie and I must be overlooking a simple thing here. But how do I typecast a string to the type needed by a mapped class, which is identified at run time? I have a class, class Record(object): pass which I map

[sqlalchemy] Reverse Foreign Key

2007-08-06 Thread Dave Marsh
Hello, I have a medium sized python project that deals with SQLalchemy to talk to a database. The thing about this project is that it doesn't define a database layout itself. It is a project that you include in other projects to provide additional database functionality. One of the more

[sqlalchemy] Re: Migrate: want to take over the project ?

2007-08-06 Thread Allen
I am very interested in this, but I don't have time to take over the project. I would be willing to work with other people to help get it working with the latest version of SA. This project is very important to the codebase I am working on right now and IMHO this is a feature that SA needs to

[sqlalchemy] Atomic update error

2007-08-06 Thread Paul Colomiets
Hi! Can somebody point me why this fails? meta = MetaData(bind=sqlite:///:memory:) blocks = Table('blocks', meta, ... Column('id', Integer, primary_key=True, autoincrement=True), ... Column('lines', Integer), ... Column('lastline', Integer), ... ) blocks.create()

[sqlalchemy] Re: Atomic update error

2007-08-06 Thread Michael Bayer
On Aug 6, 2007, at 3:22 PM, Paul Colomiets wrote: Hi! Can somebody point me why this fails? meta = MetaData(bind=sqlite:///:memory:) blocks = Table('blocks', meta, ... Column('id', Integer, primary_key=True, autoincrement=True), ... Column('lines', Integer), ...

[sqlalchemy] Re: Using a non-string in sqlalchemy

2007-08-06 Thread Michael Bayer
On Aug 6, 5:35 pm, malkarouri [EMAIL PROTECTED] wrote: On Aug 6, 4:36 pm, Michael Bayer [EMAIL PROTECTED] wrote: for parsing HTML form data into Python objects most people use FormEncode: http://formencode.org/ Thanks a lot for the suggestion. FormEncode looks great and I will

[sqlalchemy] Re: Reverse Foreign Key

2007-08-06 Thread Michael Bayer
On Aug 6, 1:38 pm, Dave Marsh [EMAIL PROTECTED] wrote: Currently, the solution is to query the database every time the page is reloaded so that the widget stays current. I would like to convert to an event driven system (re-populate the widgets only when necessary) but have hit a

[sqlalchemy] *all* *new* *tutorials* !!!!

2007-08-06 Thread Michael Bayer
Hi gang - The documentation for 0.4 is undergoing tremendous changes, and is now released, in its almost-there format, at http://www.sqlalchemy.org/docs/04/ . The goal with these docs is not just to update to new 0.4 paradigms, but to also raise the bar for accuracy and clarity. Of major note

[sqlalchemy] Query and efficient on-demand loading of all rows

2007-08-06 Thread Boris Dušek
Hi, I am using sqlalchemy like this: entries = session.query(User) for entry in entries: entry.check_it_is_all_right() # includes changing values of columns if necessary session.flush() As you might have noticed, I am iterating over all rows in the database. Since there are like

[sqlalchemy] Re: Query and efficient on-demand loading of all rows

2007-08-06 Thread Michael Bayer
On Aug 6, 2007, at 10:42 PM, Boris Dušek wrote: Hi, I am using sqlalchemy like this: entries = session.query(User) for entry in entries: entry.check_it_is_all_right() # includes changing values of columns if necessary session.flush() It would however suffice that sqlalchemy

[sqlalchemy] Re: *all* *new* *tutorials* !!!!

2007-08-06 Thread Arun Kumar PG
Cool. thx Michael! On 8/7/07, Michael Bayer [EMAIL PROTECTED] wrote: Hi gang - The documentation for 0.4 is undergoing tremendous changes, and is now released, in its almost-there format, at http://www.sqlalchemy.org/docs/04/ . The goal with these docs is not just to update to new 0.4