Home:ALL Converter>sqlalchemy argument for postgresql serial primary key in pyramid framework

sqlalchemy argument for postgresql serial primary key in pyramid framework

Ask Time:2013-03-16T14:00:09         Author:user2139543

Json Formatter

I have found related questions but can't adapt them to my situation. Here and the postgresql docs here.

I'm using sqlalchemy to interact with a postgresql db in a pyramid (python) framework (OS Ubuntu).

My schema is described in a models.py file.

I'm trying to insert the record in my views.py:

cam_event = Event(key,'fileprefix',now,'CAM',outfile,
                  'new fake project','new fake memo')

where I would like to submit a null, none, or leave the position empty ('key' position in the line above) in my add command so that posgresql will fill it in. When I do any of those I get a "Programming Error" from one of the pyramid backend bits.

Author:user2139543,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/15446121/sqlalchemy-argument-for-postgresql-serial-primary-key-in-pyramid-framework
yy