Re: [sqlalchemy] How to get id from newly inserted row

2015-11-29 Thread Mike Bayer
On 11/29/2015 10:50 AM, Sami Pietilä wrote: > Hi, > > I have postgresql database with "records" table. There is "id" > (bigserial unique primary key) column. I need to insert a row in such a > way that I get id from newly inserted row. > > ins = records.insert() > results = conn.execute(ins) >

[sqlalchemy] Lazier one-to-many relationships

2015-11-29 Thread Daniel Grace
I'm working on developing an API that, among other things, allows for partial updates or insertions to a parent's children. One minor problem that I've found is that any access to parent.children loads the entire collection -- when in many cases it's not necessary to do so. For instance,

[sqlalchemy] Re: Creating a derived class object without inserting into base class table

2015-11-29 Thread amit geron
The pattern uses SQLAlchemy directly. I'm using an extension. http://flask-sqlalchemy.pocoo.org/2.1/ On Friday, November 27, 2015 at 5:30:13 PM UTC+2, Jonathan Vanasco wrote: > > > > On Wednesday, November 25, 2015 at 5:01:38 PM UTC-5, amit geron wrote: > > >> In Flask-SQLAlchemy there are

[sqlalchemy] How to get id from newly inserted row

2015-11-29 Thread Sami Pietilä
Hi, I have postgresql database with "records" table. There is "id" (bigserial unique primary key) column. I need to insert a row in such a way that I get id from newly inserted row. ins = records.insert() results = conn.execute(ins) I was unable to find a code example of how to add

[sqlalchemy] Re: Pyramid SQLAlchemy tutorial error

2015-11-29 Thread Srikanth Bemineni
Hi, These are versions that I am using . Output from the setup.py running develop running egg_info writing top-level names to tutorial.egg-info/top_level.txt writing dependency_links to tutorial.egg-info/dependency_links.txt writing requirements to tutorial.egg-info/requires.txt writing

Re: [sqlalchemy] Pyramid SQLAlchemy tutorial error

2015-11-29 Thread Mike Bayer
On 11/29/2015 09:13 PM, Srikanth Bemineni wrote: > Hi, > > I am going through the Pyramid quick tutorial. > > While initializing the database, I am getting the below error. Can some > one point me out, what would cause this error. I am completely new to > python and pyramid moving here from

Re: [sqlalchemy] Lazier one-to-many relationships

2015-11-29 Thread Mike Bayer
On 11/29/2015 04:52 PM, Daniel Grace wrote: > I'm working on developing an API that, among other things, allows for > partial updates or insertions to a parent's children. One minor problem > that I've found is that any access to parent.children loads the entire > collection -- when in many

[sqlalchemy] Pyramid SQLAlchemy tutorial error

2015-11-29 Thread Srikanth Bemineni
Hi, I am going through the Pyramid quick tutorial. While initializing the database, I am getting the below error. Can some one point me out, what would cause this error. I am completely new to python and pyramid moving here from Ruby world.