[sqlalchemy] UniqueConstraint in __table_args__ in inherited models

2016-11-29 Thread TomS.
Hi, When I use __table_args__ like it is in the below example following warning appears: Column 'person_name' on table [...] being replaced by Column [...] which has the same key. Consider use_labels for select() statements. I know that it can be solved by adding __table_args__ to

Re: [sqlalchemy] Using Python 'sorted' doesn't change data?

2016-11-15 Thread TomS.
). On 11/08/2016 12:58 PM, TomS. wrote: Hi, I know this is silly question, but I just need confirmation - Python 'sorted' doesn't affect in any way data stored in DB? Example: class PPL(db.Model): person_pk_id = db.Column(db.Integer, primary_key=True) person_type = db.Column(db.Integer

[sqlalchemy] Using Python 'sorted' doesn't change data?

2016-11-08 Thread TomS.
Hi, I know this is silly question, but I just need confirmation - Python 'sorted' doesn't affect in any way data stored in DB? Example: class PPL(db.Model): person_pk_id = db.Column(db.Integer, primary_key=True) person_type = db.Column(db.Integer) person_order_s =

[sqlalchemy] Properly definition of Many To One/One to Many without FK

2016-09-06 Thread TomS.
Hi, In my model I am not allowed to use FK. I've been trying to figure out how one to many/many to one relationship should be properly defined or in which class to be sure that it works as expected. I've recently used very similar example - here it is: class DepTest(db.Model):

Re: [sqlalchemy] Inherited abstract model with relationship causing "Cannot compile Column object until its 'name' is assigned."

2016-09-02 Thread TomS.
On 09/02/2016 04:37 PM, Mike Bayer wrote: On 09/02/2016 10:25 AM, TomS. wrote: On 08/30/2016 08:25 PM, Mike Bayer wrote: On 08/30/2016 01:54 PM, TomS. wrote: Hi, I would like to create an abstract model which should be inherited. Unfortunately, I am not allowed to used Foreign Keys

[sqlalchemy] Inherited abstract model with relationship causing "Cannot compile Column object until its 'name' is assigned."

2016-08-30 Thread TomS.
Hi, I would like to create an abstract model which should be inherited. Unfortunately, I am not allowed to used Foreign Keys, this is the reason why I introduced work around via relationship. Here is the whole code: class DepTest(db.Model): __tablename__ = u'deptest' __bind_key__ =

Re: [sqlalchemy] SAWarning shows not immediately, but after some time of app execution

2016-08-02 Thread TomS.
On 07/22/2016 05:13 PM, Simon King wrote: On Fri, Jul 22, 2016 at 3:25 PM, TomS. <pidev...@gmail.com> wrote: On 07/19/2016 06:41 PM, Mike Bayer wrote: On 07/19/2016 11:51 AM, TomS. wrote: Hi, We have Flask app which uses SQLAlchemy. Weird error started to happen recently. The diff

Re: [sqlalchemy] SAWarning shows not immediately, but after some time of app execution

2016-07-22 Thread TomS.
On 07/19/2016 06:41 PM, Mike Bayer wrote: On 07/19/2016 11:51 AM, TomS. wrote: Hi, We have Flask app which uses SQLAlchemy. Weird error started to happen recently. The difficulty is that we can't reproduce the error (/figure out conditions causing issue) - maybe someone could help. Any hints

Re: [sqlalchemy] SAWarning shows not immediately, but after some time of app execution

2016-07-19 Thread TomS.
, Антонио Антуан wrote: Looks like `my_ids` become empty 'after some time of app execution'. How do you initialize the variable? вт, 19 июля 2016 г., 18:51 TomS. <pidev...@gmail.com <mailto:pidev...@gmail.com>>: Hi, We have Flask app which uses SQLAlchemy. Weird e

[sqlalchemy] SAWarning shows not immediately, but after some time of app execution

2016-07-19 Thread TomS.
Hi, We have Flask app which uses SQLAlchemy. Weird error started to happen recently. The difficulty is that we can't reproduce the error (/figure out conditions causing issue) - maybe someone could help. Any hints/tips would be appreciated. There is a part in the code which constructs IN in

Re: [sqlalchemy] Too slow commit?

2016-03-25 Thread TomS.
Great - I've implemented mentioned pattern and it works! Thank you! On 03/22/2016 07:10 PM, Jonathan Vanasco wrote: Yes, the approach would be to use the exact same session: dbSession = SQLSession.sql_session() functionA() functionB() dbSession.close() It looks like functionA

Re: [sqlalchemy] Too slow commit?

2016-03-22 Thread TomS.
A actually overlap (ie. does B start before A finishes)? Simon On Tue, Mar 22, 2016 at 4:07 PM, TomS. <pidev...@gmail.com <mailto:pidev...@gmail.com>> wrote: Could you advise what would be the best approach for the following problem. I have Flask-Celery task. Task con

[sqlalchemy] Too slow commit?

2016-03-22 Thread TomS.
Could you advise what would be the best approach for the following problem. I have Flask-Celery task. Task consists of two functions (both are run in the same one Celery task): A and B. Function A calculates values which are then used by B function. Values are stored in DB (via SQLAlchemy).

[sqlalchemy] @property mapping via hybrid property?

2016-02-29 Thread TomS.
\ .filter(Data.details_desc== unicode('test'))\ .all()| Cheers, TomS Exported from Notepad++ -- 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 sqlalchem

[sqlalchemy] How to cast/convert inserting data using type of column

2015-12-18 Thread TomS.
res: if hasattr(mymodel_inst, (u'prop_' + res.tag).lower()): setattr(mymodel_inst, (u'prop_' + res.tag).lower(), res.text)| I found that it can be accomplished using |isinstance| and type of column, but maybe there is simpler solution (or it is done by sqlAlchemy). Cheers, T