[sqlalchemy] Re: Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-22 Thread Etienne Rouxel
@Michael Bayer: I successfully ran your script and like my previous tests using variables to stored the results of the queries : only a single SQL query was sent. Le mardi 21 mai 2013 17:31:10 UTC+2, Etienne Rouxel a écrit : Hello In my program, I was trying to guess why so many SQL queries

[sqlalchemy] Re: Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-22 Thread Etienne Rouxel
My real application seems to share the cause for why the identity map is not used. Indeed, I have a method that encapsulate the building of a form using queries. Once the execution goes out of this method, the instances are cleared out from the identity map. I guess this is a very common

[sqlalchemy] bug in dogpile advanced example?

2013-05-22 Thread avdd
two through twelve actually shows 25 .. 40 -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send

[sqlalchemy] virtual-like entities, concrete table inheritance

2013-05-22 Thread Julien Cigar
Hello, I'm currently implementing a RBAC-like model for a webapp with the usual suspects: users, roles, permissions, etc where a Role has one or more Permissions, and an User can be in 1 or more Role. I would like to some virtual-like Role that are automatically attribued in some

Re: [sqlalchemy] Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-22 Thread Michael Bayer
usually some kind of collection of objects you want to keep is maintained, it can be passed throughout those methods, or it can be attached to the Session. It's a tradeoff between which objects you'd like to keep around between calls to things, and which you'd like to be garbage collected.

Re: [sqlalchemy] SA 0.8.0: Invalid argument(s) 'label_length'

2013-05-22 Thread Michael Bayer
this is a bug that goes back through 0.7, I've added http://www.sqlalchemy.org/trac/ticket/2732 for this. For now I don't think you need the label_length argument, the dialect should have that under control. if you do need it, you can set it after the fact: engine.dialect.label_length = 30

[sqlalchemy] Re: Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-22 Thread Etienne Rouxel
I would like that no garbage collection occurs within a session, is there a way to configure that behavior? Le mardi 21 mai 2013 17:31:10 UTC+2, Etienne Rouxel a écrit : Hello In my program, I was trying to guess why so many SQL queries were sent while some could have been avoided with the

Re: [sqlalchemy] virtual-like entities, concrete table inheritance

2013-05-22 Thread Michael Bayer
On May 22, 2013, at 7:14 AM, Julien Cigar jci...@ulb.ac.be wrote: Hello, I'm currently implementing a RBAC-like model for a webapp with the usual suspects: users, roles, permissions, etc where a Role has one or more Permissions, and an User can be in 1 or more Role. I would like to

Re: [sqlalchemy] Are consecutive query.get calls supposed to send a single SELECT query?

2013-05-22 Thread Michael Bayer
there's a specific way that I've been trying to deprecate for years, sure, send weak_identity_map=False to the Session constructor. If it were me, I'd use an on_load event and just stick each object into a dictionary associated with the Session. On May 22, 2013, at 12:11 PM, Etienne

Re: [sqlalchemy] SA 0.8.0: Invalid argument(s) 'label_length'

2013-05-22 Thread Anthony Kong
Hi, Michale, Thanks very much! Setting the label_length after the engine creation works for us! Cheers On Thursday, May 23, 2013 2:09:30 AM UTC+10, Michael Bayer wrote: this is a bug that goes back through 0.7, I've added http://www.sqlalchemy.org/trac/ticket/2732 for this. For now I

[sqlalchemy] sqlalchemy does not enforce foreign key constraint

2013-05-22 Thread Shyam Purkayastha
I am trying to play with the sql alchemy ORM based db definition with an inmemory sqlite db. I have defined my tables as follows class Customer(Base): __tablename__ = 'customer' id = Column(Integer, primary_key=True) name = Column(String(80)) auth =

[sqlalchemy] how to use bind_expression to build an express like 'convert(bit, @value)?

2013-05-22 Thread Anthony Kong
Hi, all, We are upgrading our application to use SA0.8.0. For reason outside our control, some XP workstations are using old sybase ODBC driver and we cannot upgrade them as of yet. The sybase driver will cause this problem in the following situation: 1) we have a table that have a field of