Re: [sqlalchemy] generate top-level python code for an alembic revision from render_item

2020-05-06 Thread Adrian
Works great, thanks! -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received

Re: [sqlalchemy] generate top-level python code for an alembic revision from render_item

2020-05-05 Thread Mike Bayer
it's pretty doable if you add a new ${thing} to your mako template. getting a value in there requires a trick, there's an example of it here: https://github.com/sqlalchemy/alembic/issues/686#issuecomment-616828129 which is to put a dictionary inside of another dictionary and pass that as

[sqlalchemy] generate top-level python code for an alembic revision from render_item

2020-05-05 Thread Adrian
I have a custom type implementing enums (no idea if there's something better now, but it's used in many places so replacing it is not an option atm). Currently I'm using render_item to simply import the type and the enum and pass the enum to the type and it works fine. However, in the alembic