[sqlalchemy] UPDATE intelligence

2007-08-04 Thread Boris Dušek
Hi, I am using sqlalchemy and have following problem: it happens to me that I get a row (mapped to an object using sqa.orm.mapper) and write to an entry, like user.age = 33. When user.age already was 33, then when I do session.flush(), the age column still gets updated with the value 33. It's a

[sqlalchemy] Re: UPDATE intelligence

2007-08-04 Thread Alexandre CONRAD
Hello Boris, I might not be well waken up, but as I'm looking at your generated SA logs, it doesn't show that SA updates the row when the data has not changed. It only seems to update fields that have changed. Or maybe your talking about the empty BEGIN / COMMIT block that is beeing sent

[sqlalchemy] Re: UPDATE intelligence

2007-08-04 Thread Alexandre CONRAD
Alexandre CONRAD wrote: I might not be well waken up, but as I'm looking at your generated SA logs, it doesn't show that SA updates the row when the data has not changed. It only seems to update fields that have changed. Or maybe should I say that I don't see the data beeing updated even

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Alexandre CONRAD
Alexandre CONRAD wrote: Ok, maybe I got influenced by articles about nested sets beeing better, as pointed Mike. Now I got you guys advices, I'll look deeper into adjacency list. I'm glad I've had such feedback on my problem. This defenitly helps, even more when you just don't know from

[sqlalchemy] Re: UPDATE intelligence

2007-08-04 Thread Michael Bayer
On Aug 4, 2007, at 4:10 AM, Boris Dušek wrote: So - how is it with sqlalchemy and intelligence when writing to an instance of orm-mapped class? Does sqlalchemy behave intelligent just by coincidence in some cases (like this one) and in other not? it issues an UPDATE to a specific column

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Michael Bayer
On Aug 4, 2007, at 7:43 AM, Alexandre CONRAD wrote: Alexandre CONRAD wrote: Ok, maybe I got influenced by articles about nested sets beeing better, as pointed Mike. Now I got you guys advices, I'll look deeper into adjacency list. I'm glad I've had such feedback on my problem. This

[sqlalchemy] Inheritance trouble

2007-08-04 Thread Leonid Morgun
I tried to use http://www.sqlalchemy.org/docs/adv_datamapping.html#advdatamapping_inheritance_joined -- Joined Table Inheritance. And according to that example in documentation, I need to add a new worker: at the beginning I had a simple employee (and the record in employees' table). Than I

[sqlalchemy] Re: UPDATE intelligence

2007-08-04 Thread Boris Dušek
Hi Alexandre, On Aug 4, 2:33 am, Alexandre CONRAD [EMAIL PROTECTED] wrote: Hello Boris, I might not be well waken up, but as I'm looking at your generated SA logs, it doesn't show that SA updates the row when the data has not changed. It only seems to update fields that have changed. You

[sqlalchemy] Re: UPDATE intelligence

2007-08-04 Thread jason kirtland
Boris Dušek wrote: 2. I was assigning Python-bool value (True,False) to a TINYINT(1) column. But No 2. - maybe sqlalchemy could know that True is 1 and False is 0 because MySQL (the database to which I connect) treats its own BOOL type as an alias to TINYINT(1)? The Boolean column type

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Alex Conrad
Hi again, On Aug 4, 5:41 pm, Michael Bayer [EMAIL PROTECTED] wrote: snip no, youre free to order by whatever crierion youd like. the examples return the nodes in insert order and will duplicate the input document. snip you can order by whatever you like. the example is ordering in the

[sqlalchemy] Re: Hierachical data

2007-08-04 Thread Michael Bayer
On Aug 4, 2007, at 5:52 PM, Alex Conrad wrote: The XML I showed was just an example to illustrate my problem. Sorry if this was confusing. Right now, I have an application that uses XML, it's true, but I'm rewriting the whole application. I had a feeling this was the case, but I just try to