On Jan 30, 2014, at 1:28 PM, jason.cl...@360pi.com wrote: > I'm wondering if there is a better way of getting around an issue I ran into > with Alembic, what I did is below.
I’ve updated the documentation and also added a new feature user_module_prefix in the upcoming 0.6.3 to address this specifically. See: http://alembic.readthedocs.org/en/latest/tutorial.html#rendering-custom-types-in-autogenerate (note that these docs apply to 0.6.2 as well) and http://alembic.readthedocs.org/en/latest/tutorial.html#controlling-the-module-prefix (new feature in 0.6.3) > > I have models which have custom type decorators, when I ran alembic it > complained that SafeGuid wasn't on the model. I found a post from someone > that said the only way around this was to redirect to the types directly in > SqlAlchemy like below. Any ideas if there is a cleaner way? > > > env.py > > from myproj.typedecorators import ( > SafeGuid, Upc, SafeDecimal, SafeKeyValuePropertyBag, SafeBigInteger) > > # this is to get around an issue in SqlAlchemy where it looks for the > # type decorators on the model. We are just redirecting to the real > # implementation of the decorator here. > import sqlalchemy as sa > sa.SafeGuid = SafeGuid > sa.Upc = Upc > sa.SafeDecimal = SafeDecimal > sa.SafeKeyValuePropertyBag = SafeKeyValuePropertyBag > sa.SafeBigInteger = SafeBigInteger > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy-alembic" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy-alembic+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out.
signature.asc
Description: Message signed with OpenPGP using GPGMail