Re: [sqlalchemy] Re: insertion into association table, giving integrityerror

2017-04-09 Thread mike bayer
On 04/09/2017 02:18 PM, shrey.chau...@invicto.in wrote: Traceback (most recent call last): File "/home/schauhan/NewOrchestrator/session_broker/session_broker/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File

[sqlalchemy] Re: insertion into association table, giving integrityerror

2017-04-09 Thread shrey . chauhan
Traceback (most recent call last): File "/home/schauhan/NewOrchestrator/session_broker/session_broker/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File

Re: [sqlalchemy] move objects between two sessions

2017-04-09 Thread A.M.
On 04/09/2017 10:52 AM, SG wrote: > I have two databases with one session for each of them. > I would like to move objects contained in one of them to the other. > I tried to get an object from the first with something like: > > | > obj =sessionA.query(MyClass).filter(MyClass.name=='some name') >

[sqlalchemy] move objects between two sessions

2017-04-09 Thread SG
I have two databases with one session for each of them. I would like to move objects contained in one of them to the other. I tried to get an object from the first with something like: obj = sessionA.query(MyClass).filter(MyClass.name == 'some name') and then I tried to add this object to the

Re: [sqlalchemy] insertion into association table, giving integrityerror

2017-04-09 Thread mike bayer
On 04/09/2017 09:23 AM, shrey.chau...@invicto.in wrote: I am working with a python application where I am using flask-sqlalchemy as ORM, here I am facing a situation due to some reason I am getting integrity error, i ll show the models: (I have a many to many relationship between these 2

[sqlalchemy] insertion into association table, giving integrityerror

2017-04-09 Thread shrey . chauhan
I am working with a python application where I am using flask-sqlalchemy as ORM, here I am facing a situation due to some reason I am getting integrity error, i ll show the models: (I have a many to many relationship between these 2 models) class Package(db.Model, BaseMixin): __tablename__