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

2017-04-12 Thread shrey . chauhan
Sorry not the first one, but the second one -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.

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

2017-04-11 Thread shrey . chauhan
Thanks Mike for suggestions, was able to solve both the issues with slight changes in the db models added lazy='dynamic' on both sides where back_populates is being used -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code,

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

2017-04-11 Thread mike bayer
On 04/11/2017 02:37 AM, shrey.chau...@invicto.in wrote: Yes Mike will do that, mostly its marshmallow model schema which is creating the object, as I am using Flask + marshmallow for APIs, p.groups=[] //when i try to empty it, i get this exception *AssertionError: Collection was

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

2017-04-11 Thread shrey . chauhan
Yes Mike will do that, mostly its marshmallow model schema which is creating the object, as I am using Flask + marshmallow for APIs, apart from that I have another issue, which i am not able to uderstand: I have a many-to-many relationship between 2 models, same as posted above, still ill put

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

2017-04-10 Thread mike bayer
On 04/10/2017 03:46 AM, shrey.chau...@invicto.in wrote: A package object is getting created, and its inserting it into database, have to debug why is it inserting into db Somehow i got it working, added: db.session.rollback(), before append statement Dont know whether its the right approach

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

2017-04-10 Thread shrey . chauhan
A package object is getting created, and its inserting it into database, have to debug why is it inserting into db Somehow i got it working, added: db.session.rollback(), before append statement Dont know whether its the right approach Thanks -- SQLAlchemy - The Python SQL Toolkit and

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