[sqlalchemy] Use a set as collection for a many-to-many relationship

2018-09-28 Thread rdebroiz
I'd like to do something like: children = relationship("Child", secondary=association_table, collection_class=set) But I get: *TypeError: Incompatible collection type: set is not list-like* Is there a way to achieve it or set is not compatible with many-to-many relationship? --

[sqlalchemy] How to customize base declarative class to add naming conventions

2018-09-04 Thread rdebroiz
I'd like to create a mixin to specify naming conventions. I tried both: class Base: metadata = MetaData(naming_convention={ "ix": "ix_%(column_0_label)s", "uq": "uq_%(table_name)s_%(column_0_name)s", "ck": "ck_%(table_name)s_%(constraint_name)s", "fk":

autogenerate revision fails in a multi-db project generated with: `alembic init --template multidb alembic`

2018-08-10 Thread rdebroiz
invoking *`alembic --raiseerr revision --autogenerate -m 'First revision`*: [...] Generating /home/rdebroiz/Quantivly/services/alembic/versions/201808-10-T12- 30-48-first_revision-cb8c6da27574.py ... FAILED Traceback (most recent call last): File "/home/rdebroiz/.virtualenvs/quantivly/lib/pyth