Re: [sqlalchemy] Problem inserting records in blob column

2013-12-20 Thread Massi
Hi, I'm experiencing a similar problem in my program (Sqlalchemy 0.8.4). In my case no blob column is involved, the problem seems to be related to presence of a foreign key in the target table. Here is the traceback of the error: File C:\Python27\lib\site-packages\sqlalchemy\orm\session.py,

Re: [sqlalchemy] How to declare a custom type that will imply a check on a column?

2013-12-20 Thread RonnyPfannschmidt
The example works wonderfully, however i noticed, that when i attach a constraint to the column, it gets mirrored in the table so the event handler @event.listens_for(PString, after_parent_attach) def create_constraint(target, parent): @event.listens_for(parent, after_parent_attach)

Re: [sqlalchemy] How to declare a custom type that will imply a check on a column?

2013-12-20 Thread RonnyPfannschmidt
i discovered a workaround by doing @event.listens_for(PString, after_parent_attach) def create_constraint(target, parent): @event.listens_for(parent, after_parent_attach) def add_to_table(col, table): constraint = CheckConstraint(column(col.name) != text(''), _autoattach=False)

Re: [sqlalchemy] Problem inserting records in blob column

2013-12-20 Thread Michael Bayer
there’s a SQLAlchemy issue here, marked as ticket http://www.sqlalchemy.org/trac/ticket/2896, however resolving this issue still won’t fix your issue. You’re emitting an INSERT on a table where the primary key needs to refer to a column elsewhere. that is: task = Table('y', metadata,

Re: [sqlalchemy] Problem inserting records in blob column

2013-12-20 Thread Michael Bayer
issue #2896 is resolved for 0.8.5 and 0.9.0. On Dec 20, 2013, at 10:03 AM, Michael Bayer mike...@zzzcomputing.com wrote: there’s a SQLAlchemy issue here, marked as ticket http://www.sqlalchemy.org/trac/ticket/2896, however resolving this issue still won’t fix your issue. You’re emitting

Re: [sqlalchemy] How to declare a custom type that will imply a check on a column?

2013-12-20 Thread Michael Bayer
On Dec 20, 2013, at 8:45 AM, RonnyPfannschmidt ronny.pfannschm...@gmail.com wrote: The example works wonderfully, however i noticed, that when i attach a constraint to the column, it gets mirrored in the table so the event handler @event.listens_for(PString, after_parent_attach)