[sqlalchemy] Re: Sqlalchemy with different application scenarios

2009-12-28 Thread karikris...@gmail.com
Is that mean, having separate session per library and one application session which combines both is not possible at this moment? So keeping them at the application level may help me at this point of time. Thank you for suggestion. Regards, Krish On Dec 27, 9:09 pm, Michael Bayer

[sqlalchemy] Re: declarative and session

2009-12-28 Thread karikris...@gmail.com
Thank you so much. I will try adding base class derived from declarative base and implement save, update and delete methods. Regards, Krish On Dec 27, 2:19 pm, Serge Koval serge.ko...@gmail.com wrote: You can always do self.session.add(self) in save() without checks. If your model was already

[sqlalchemy] No such polymorphic_identity is defined

2009-12-28 Thread moggie
Greetings, Hope you are well. In my example I have two objects 'HttpTest' and 'SmtpTest' that both inherit from their super-class called 'Test'. Due to the nature of the relationship, 'Test' will never actually be stored in the database so I've not mapped that. However, a mixture of 'HttpTest'

Re: [sqlalchemy] No such polymorphic_identity is defined

2009-12-28 Thread Michael Bayer
moggie wrote: Greetings, Hope you are well. In my example I have two objects 'HttpTest' and 'SmtpTest' that both inherit from their super-class called 'Test'. Due to the nature of the relationship, 'Test' will never actually be stored in the database so I've not mapped that. However, a

Re: [sqlalchemy] Re: Mapping temporal data for easy querying using time dimension

2009-12-28 Thread Michael Bayer
Adam Dziendziel wrote: On 27 Gru, 19:58, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 27, 2009, at 12:01 PM, Adam Dziendziel wrote: this answer to this required enough creativity and testing that I made it into a usage recipe. Please give it a road test

[sqlalchemy] Re: Mapping temporal data for easy querying using time dimension

2009-12-28 Thread Adam Dziendziel
On 28 Gru, 20:19, Michael Bayer mike...@zzzcomputing.com wrote: query.get() doesn't work with filtering criterion.  This because it looks up in the current session by primary key, and if present issues no SQL. If it were filtered, you'd get different results based on whether or not the object

Re: [sqlalchemy] Re: Mapping temporal data for easy querying using time dimension

2009-12-28 Thread Michael Bayer
Adam Dziendziel wrote: On 28 Gru, 20:19, Michael Bayer mike...@zzzcomputing.com wrote: query.get() doesn't work with filtering criterion.  This because it looks up in the current session by primary key, and if present issues no SQL. If it were filtered, you'd get different results based on

[sqlalchemy] Looking for a schema / database migration tool

2009-12-28 Thread Yannick Gingras
Greetings Alchemists, I'm looking for a schema migration tool, ideally one that works well with SQLAlchemy. I know about sqlalchemy-migrate but I find its monotone numbering scheme hard to reconcile with distributed development. More details on that specific problem on their mailing list:

[sqlalchemy] is there any sort of find_or_create query?

2009-12-28 Thread CoolAJ86
If I have an object User in rails with attributes first, last, and password I can do something like this user = {:first = 'John', :last = 'Doe'} # a dict-like object user = Users.find_or_create(user) is there any such convenience method in sqlalchemy? -- You received this message because you

Re: [sqlalchemy] is there any sort of find_or_create query?

2009-12-28 Thread AJ ONeal
It looks like the answer to my question is no. Is there any add-on (Elixer or whatever) which has a shortcut method like what I'm asking? I did find that insert_or_update is not the solution. I also found an appropriate, but longer way to read or create: page =