Re: [sqlalchemy] CheckConstraints defined as an expression on a ColumnClause

2017-04-04 Thread Luca Wehrstedt
;, echo=True) > > m.create_all(e) > > and we see: > > CREATE TABLE t ( > x VARCHAR, > CHECK (x ~ '^[A-Za-z0-9_-]+$') > ) > > > > So something else must be happening here, for which I'd need more detail > as to how you

[sqlalchemy] CheckConstraints defined as an expression on a ColumnClause

2017-04-03 Thread Luca Wehrstedt
Hi, I was trying to define a subclass of CheckConstraint to match a column (whose name is given) to a regexp. class CodenameConstraint(CheckConstraint): """Check that the column uses a limited alphabet.""" def __init__(self, column_name): column = ColumnClause(column_name)

Re: [sqlalchemy] Define a custom collection

2013-01-16 Thread Luca Wehrstedt
Done. https://bitbucket.org/sqlalchemy/sqlalchemy/pull-request/36/fix-the-collectionlink-decorator http://www.sqlalchemy.org/trac/ticket/2653 http://www.sqlalchemy.org/trac/ticket/2654 -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view thi

Re: [sqlalchemy] Define a custom collection

2013-01-15 Thread Luca Wehrstedt
Thanks for the reply. I started diving into the code to debug the issues and, perhaps, write a patch to fix them and I think I discovered their causes. The problem with the "link" decorator is the following: - the "@collection.link"[1] decorator sets the "_sa_instrument_role" of the meth

[sqlalchemy] Define a custom collection

2013-01-14 Thread Luca Wehrstedt
Hello everyone, I'm posting here because I don't know if the issues I'm having are bugs or just improper use of the library. I'd like to define a custom collection class since I'm not completely satisfied by the default ones. In particular I'd like to subclass MappedCollection and make it prov