[sqlalchemy] passive_deletes/updates with sqlite

2010-09-10 Thread alex
hello friends, as sqlite has recently introduced support for on delete/update cascade, i'd like to implement the passive_* functionality for this driver too. please give me a hint where to start. best regards, alex -- You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: Python's reserved keywords as column names

2010-09-10 Thread Andrey Semyonov
On 10 сен, 17:15, King Simon-NFHD78 simon.k...@motorola.com wrote: Hi Andrey, See the section in the docs 'Attribute Names for Mapped Columns': http://www.sqlalchemy.org/docs/orm/mapper_config.html#attribute-names-fo r-mapped-columns Hope that helps, Simon Well, this leads to the only

RE: [sqlalchemy] Re: Python's reserved keywords as column names

2010-09-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Andrey Semyonov Sent: 10 September 2010 14:35 To: sqlalchemy Subject: [sqlalchemy] Re: Python's reserved keywords as column names On 10 сен, 17:15, King Simon-NFHD78

Re: [sqlalchemy] Re: Python's reserved keywords as column names

2010-09-10 Thread Michael Bayer
On Sep 10, 2010, at 9:35 AM, Andrey Semyonov wrote: On 10 сен, 17:15, King Simon-NFHD78 simon.k...@motorola.com wrote: Hi Andrey, See the section in the docs 'Attribute Names for Mapped Columns': http://www.sqlalchemy.org/docs/orm/mapper_config.html#attribute-names-fo r-mapped-columns

Re: [sqlalchemy] passive_deletes/updates with sqlite

2010-09-10 Thread Michael Bayer
On Sep 10, 2010, at 4:13 AM, alex wrote: hello friends, as sqlite has recently introduced support for on delete/update cascade, i'd like to implement the passive_* functionality for this driver too. please give me a hint where to start. passive_delete and passive_update are database

Re: [sqlalchemy] IS versus = for booleans in postgresql

2010-09-10 Thread Michael Bayer
On Sep 10, 2010, at 11:47 AM, Jon Nelson wrote: I found something interesting recently: I have a table with a boolean column. When I wrote (low-level) sqlalchemy code, I used constructs like this: query = query.where(table.c.boolean_column==True) and when executed the query uses '='.

Re: [sqlalchemy] Re: Loading attributes for Transient objects

2010-09-10 Thread Kent Bower
I'm wondering if you think my use case is one you would like to support, or if you think it is sort of off on its own (I could tell I wasn't explaining our use case extremely well)... Regardless, I am setting the InstrumentedAttribute's implementation's callable_ so I have control over

Re: [sqlalchemy] Re: Loading attributes for Transient objects

2010-09-10 Thread Michael Bayer
On Sep 10, 2010, at 12:24 PM, Kent Bower wrote: I'm wondering if you think my use case is one you would like to support, or if you think it is sort of off on its own (I could tell I wasn't explaining our use case extremely well)... Regardless, I am setting the InstrumentedAttribute's

[sqlalchemy] Update a record in a table

2010-09-10 Thread Alvaro Reinoso
I have some problems when I try to update information in some tables. For example, I have this table: class Channel(rdb.Model): rdb.metadata(metadata) rdb.tablename(channels) id = Column(id, Integer, primary_key=True) title = Column(title, String(100))

[sqlalchemy] Updating a detached object

2010-09-10 Thread Alvaro Reinoso
Hello guys, I have this table: class Channel(rdb.Model): rdb.metadata(metadata) rdb.tablename(channels) id = Column(id, Integer, primary_key=True) title = Column(title, String(100)) hash = Column(hash, String(50)) runtime = Column(runtime,

Re: [sqlalchemy] Re: Loading attributes for Transient objects

2010-09-10 Thread Michael Bayer
Sent from my iPhone On Sep 10, 2010, at 2:11 PM, Kent Bower k...@retailarchitects.com wrote: I'm headed that direction now, thanks. I didn't find anything on the wiki for how to plug in a subclassed CollectionAttributeImpl, for example. I could hack it, but is there a public or

Re: [sqlalchemy] Re: Loading attributes for Transient objects

2010-09-10 Thread Kent Bower
I've got a fix for our project. Python is really cool about letting you reassign methods and functions, so I just reassigned CollectionAttributeImpl._set_iterable to my own function. The point is, for my sake, don't worry about a public API, unless others also ask about it... Thanks for

Re: [sqlalchemy] Re: Loading attributes for Transient objects

2010-09-10 Thread Michael Bayer
I almost needed the exact same feature you have the other day.So I wouldn't close the book on it. I just know that as default behavior, or even readily switchable behavior, non-invested users get confused rather quickly. On Sep 10, 2010, at 4:21 PM, Kent Bower wrote: I've got a fix for

Re: [sqlalchemy] Updating a detached object

2010-09-10 Thread Michael Bayer
On Sep 10, 2010, at 2:57 PM, Alvaro Reinoso wrote: Hello guys, I have this table: class Channel(rdb.Model): rdb.metadata(metadata) rdb.tablename(channels) id = Column(id, Integer, primary_key=True) title = Column(title, String(100)) hash =

Re: [sqlalchemy] Re: Loading attributes for Transient objects

2010-09-10 Thread Kent Bower
Actually, my coworker and I were discussing, if the foreign key is specified, whether transient, pending (with autoflush off), or persistent, you intuitively *expect* that referencing the attribute will load the persistent related object. The difficultly for sqlalchemy is that you have no