-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- tried it out in my work project, and realized the "op" and "context…
…" namespaces need to be there fully and in particular "context" needs to be a proxy object, as env.py may have dependencies which live beyond the scope of the migration script. Will have to try to make these proxies as straightforward as possible. - more architecture docs
- Loading branch information
Showing
8 changed files
with
217 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from alembic.operations import Operations | ||
|
||
# create proxy functions for | ||
# each method on the Operations class. | ||
|
||
# TODO: this is a quick and dirty version of this. | ||
# Ideally, we'd be duplicating method signatures | ||
# and such, using eval(), etc. | ||
|
||
_proxy = None | ||
def _create_op_proxy(name): | ||
def go(*arg, **kw): | ||
return getattr(_proxy, name)(*arg, **kw) | ||
go.__name__ = name | ||
return go | ||
|
||
for methname in dir(Operations): | ||
if not methname.startswith('_'): | ||
locals()[methname] = _create_op_proxy(methname) |
Oops, something went wrong.