[sqlalchemy] Abstracting common hybrid properties

2019-09-23 Thread Gary L
I have a small model with a 'json' column called details and several hybrid properties to abstract getting from it safely: User(Base): @hybrid_property def phone_number_2(self): return self.details.get('phone_num_2') However when I use this in a query, in the class context, I get

Re: [sqlalchemy] Column name collision with method name

2019-09-13 Thread Gary L
This worked great, thank you for the help! On Friday, September 13, 2019 at 11:16:06 AM UTC-4, Mike Bayer wrote: > > > > On Fri, Sep 13, 2019, at 10:46 AM, Gary L wrote: > > I have a declarative model as below > > > class User(Base): > __tablename__

[sqlalchemy] Column name collision with method name

2019-09-13 Thread Gary L
I have a declarative model as below class User(Base): __tablename__ = 'users' __table_args__ = { 'schema':'internal', 'extend_existing': True, 'mustexist': True } The table has a column named 'registration_date'. Since I am working with pandas I'd like

[sqlalchemy] Urgent required Java Developer - Washington, DC

2014-05-28 Thread Gary .
skills, can work independently, strong oops concept, design exposure, and oracle db exposure via java programming. Thanks and Regards, Gurjant Singh - (Gary) Technical Recruiter +1 212 389 9503 ext 208 E: gurjant.si...@damcosoft.com *NY Office: *112 W 34th St, 18th Floor, New York, NY 10120

[sqlalchemy] Urgent required .Net Developer - Dublin, OH

2014-05-28 Thread Gary .
, Gurjant Singh - (Gary) Technical Recruiter +1 212 389 9503 ext 208 E: gurjant.si...@damcosoft.com *NY Office: *112 W 34th St, 18th Floor, New York, NY 10120 *NJ Office: *894 Green Street, Suite B, Iselin, NJ 08830 Corporate: www.damcosoft.com *[image: Description: cid:image002.jpg@01CEDAE3

[sqlalchemy] How to close database connection of a session?

2011-04-05 Thread Gary Shi
I found session.close() doesn't close the database connection (by calling session.close and sleep, then check the network connections), neither session.connection().close(). How to close the connection without quit my application? -- You received this message because you are subscribed to the

Re: [sqlalchemy] How to close database connection of a session?

2011-04-05 Thread Gary Shi
session.bind.dispose() León Domingo *ender* *LA FACTORÍA DE SOFTWARE* Av. Cerro del Águila 7, 2ª planta - S23 28703 S.S. de los Reyes Madrid tlf. y fax: 902 01 44 01 *www.ender.es* On 5 April 2011 07:47, Gary Shi gary...@gmail.com wrote: I found session.close() doesn't close the database

Re: [sqlalchemy] how to handle deadlock

2010-05-06 Thread gary clark
try: Perform table transaction break except: rollback delay try again to perform table transaction I'm sure you will get the gist of the above and why. I also set my isolation_level to READ UNCOMMITED. Thanks, Garyc --- On Thu, 5/6/10, rajasekhar911

[sqlalchemy] setting the transaction isolation_level?

2010-04-27 Thread gary clark
Hello, I'm using SQLAlchemy with sqlite 3.6.23. I would like to know how you set the transaction isolation_level=immediate. I think this will help with the deadlocks I was having. Just dont know how to implement this. Thanks, Garyc -- You received this message because you are subscribed to

Re: [sqlalchemy] setting the transaction isolation_level?

2010-04-27 Thread gary clark
? To: sqlalchemy@googlegroups.com Date: Tuesday, April 27, 2010, 3:30 PM gary clark wrote: Hello, I'm using SQLAlchemy with sqlite 3.6.23. I would like to know how you set the transaction isolation_level=immediate. I think this will help with the deadlocks I was having. Just dont know

Re: [sqlalchemy] Re: Database locking

2010-04-26 Thread gary clark
Thanks Michael. I am going to do some more research on SQLAlchemy and how it handles locks and its interaction with sqlite. I will try and post my findings next week. Thanks, Garyc --- On Mon, 4/26/10, Michael Bayer mike...@zzzcomputing.com wrote: From: Michael Bayer mike...@zzzcomputing.com

[sqlalchemy] Re: SA skips integrity referential?

2007-02-16 Thread Gary Bernhardt
Referential integrity isn't being violated here - SA is nulling the foreign key before deleting the row it points to. Try adding nullable=False to the declaration of attivita.cod_specie. That should make it fail in the way you expect, because SA will no longer be able to null the foreign key.

[sqlalchemy] Re: PostGreSQL Referential Integrity with composed primary key

2007-02-15 Thread Gary Bernhardt
The pr_PurchaseRequisition_has_CELLS_budget_has_CELLS_costCenter table is the one that's causing your problem. It has a foreign key to CELLS_budget_has_CELLS_costCenter.CELLS_budget_ID (and another to CELLS_costCenter_ID on the same table). Neither of those two columns are unique. If you add

[sqlalchemy] Re: PostGreSQL Referential Integrity with composed primary key

2007-02-15 Thread Gary Bernhardt
with ForeignKeyConstraint. Search for it at http://www.sqlalchemy.org/docs/metadata.myt. So there is no solution to get it running with this requirement in postgresql ? (except defining a new ID but I cannot change the schema) On 15 Feb., 21:03, Gary Bernhardt [EMAIL PROTECTED] wrote

[sqlalchemy] Re: Is there any way to call a python function for primary key generation

2007-02-13 Thread Gary Bernhardt
On 2/13/07, vinjvinj [EMAIL PROTECTED] wrote: Found the answer: # a function to create primary key ids i = 0 def mydefault(): global i i += 1 return i This counter is going to start over every time you run your program. The second time you run it, it's going to start

[sqlalchemy] Re: Newbie question about select statement

2007-02-13 Thread Gary Bernhardt
The Working with Large Collections section in the advanced mapping docs is probably what you want: http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_properties_working On 2/13/07, Cristiano Paris [EMAIL PROTECTED] wrote: I everyone. I'm pretty new to SQLAlchemy and never done

[sqlalchemy] Re: Is there any way to call a python function for primary key generation

2007-02-13 Thread Gary Bernhardt
On 2/13/07, vinjvinj [EMAIL PROTECTED] wrote: This counter is going to start over every time you run your program. The second time you run it, it's going to start creating IDs that already exist, You missed my first post, which stated: I most certainly did. My apologies. :) I use the