[sqlalchemy] Re: Automatically retrieving the row index

2011-04-08 Thread Franck
Thanks Mike ! It was exactly the kind of tool I was looking for. Cheers, Franck On Apr 7, 1:20 pm, Mike Conley mconl...@gmail.com wrote: Take a look at using ordering_list for the collection class on your relation. You add a position in season and SQLAlchemy will maintain the value.

[sqlalchemy] ImmutableColumnCollection in 0.7b3

2011-04-08 Thread Szumo
Hello all, I've a following piece of code that used to work fine with SA 0.6.6, but no longer works with 0.7 due to table.columns becoming an immutable collection. def alterTableDropColumns(connection, table, *columns): Drop some columns of a table. Parameters are expected to be

Re: [sqlalchemy] Re: Problem with SAWarning: Multiple rows returned with uselist=False

2011-04-08 Thread Michael Bayer
On Apr 8, 2011, at 7:08 AM, Aleksander Siewierski wrote: Thanks for response, TaskIntro table is defined as: Table( 'task_intros', METADATA, Column('id', Integer, primary_key=True), ... Column('redirect_rule_id', Integer,

Re: [sqlalchemy] ImmutableColumnCollection in 0.7b3

2011-04-08 Thread Michael Bayer
On Apr 8, 2011, at 7:57 AM, Szumo wrote: Hello all, I've a following piece of code that used to work fine with SA 0.6.6, but no longer works with 0.7 due to table.columns becoming an immutable collection. def alterTableDropColumns(connection, table, *columns): Drop some columns

[sqlalchemy] Oracle - create_engine fails - no attribute 'paramstyle'

2011-04-08 Thread thanos
Using cx_oracle presents no problems but when I use engine = create_engine('oracle://uid:pwd@test1120') dialect = dialect_cls(**dialect_args) File c:\python26\lib\site-packages\sqlalchemy-0.6.4-py2.6.egg \sqlalchemy\dialects\oracle\cx_oracle.py, line 411, in __init__

[sqlalchemy] Navigate through tree-like structure with sqlalchemy. Is it doable (now) ?

2011-04-08 Thread Hector Blanco
Hello everyone: I have a tree-like structure (groups/nodes, basically) with Stores and StoreGroups. An store can belong only to one storeGroup, but an StoreGroup can contain stores or other storeGroups: class StoreGroup(BaseClass.BaseClass, Database.Base): Represents a storeGroup

Re: [sqlalchemy] Oracle - create_engine fails - no attribute 'paramstyle'

2011-04-08 Thread Michael Bayer
that's a cx_oracle problem of some kind (like installation or version). paramstyle is a required attribute of a DBAPI and cx_oracle has it: import cx_Oracle cx_Oracle.paramstyle 'named' from sqlalchemy import * e = create_engine('oracle://uid:pwd@test1120') e.dialect

Re: [sqlalchemy] saving existing db object

2011-04-08 Thread Michael Bayer
On Apr 8, 2011, at 10:54 AM, gwozdziu wrote: Hi! In SqlAlchemy 0.4 when I tried to save (using method save) to database object which interferes row which already exists in database (for example I have table with primary key `id`, row with id = 3 in this table, and I am trying to save

Re: [sqlalchemy] Navigate through tree-like structure with sqlalchemy. Is it doable (now) ?

2011-04-08 Thread Michael Bayer
On Apr 8, 2011, at 12:12 PM, Hector Blanco wrote: Hello everyone: I have a tree-like structure (groups/nodes, basically) with Stores and StoreGroups. An store can belong only to one storeGroup, but an StoreGroup can contain stores or other storeGroups: class

[sqlalchemy] Re: saving existing db object

2011-04-08 Thread gwozdziu
On Apr 8, 6:34 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Apr 8, 2011, at 10:54 AM, gwozdziu wrote: Hi! In SqlAlchemy 0.4 when I tried to save (using method save) to database object which interferes row which already exists in database (for example I have table with primary

[sqlalchemy] Re: saving existing db object

2011-04-08 Thread gwozdziu
On Apr 8, 6:48 pm, gwozdziu sz.gwo...@gmail.com wrote: On Apr 8, 6:34 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Apr 8, 2011, at 10:54 AM, gwozdziu wrote: Hi! In SqlAlchemy 0.4 when I tried to save (using method save) to database object which interferes row which already

Re: [sqlalchemy] Navigate through tree-like structure with sqlalchemy. Is it doable (now) ?

2011-04-08 Thread Hector Blanco
Thanks for the quick reply. I'll give it a try. 2011/4/8 Michael Bayer mike...@zzzcomputing.com: On Apr 8, 2011, at 12:12 PM, Hector Blanco wrote: Hello everyone: I have a tree-like structure (groups/nodes, basically) with Stores and StoreGroups. An store can belong only to one

Re: [sqlalchemy] Re: saving existing db object

2011-04-08 Thread Michael Bayer
On Apr 8, 2011, at 12:59 PM, gwozdziu wrote: #before executing this code we have object with id = 5 in our database obj = self.mapper.get_from_dto(dto) # creating the object from values provided by user , this object has id = 5 self.mapper.add(obj) # we are putting new object (with id =