For a trigger template something like:
trg_template = """
CREATE TRIGGER trg_foo_{0}
AFTER {0} ON foo
FOR EACH ROW
BEGIN
...
END;
"""
Why does the following not work to remove some redundant boiler plate code:
for x in 'UPDATE', 'INSERT', 'DELETE':
event.listen(
Foo.__table__, "after_create",
lambda *args, **kwargs:
DDL(trg_template.format(x)).execute(bind=engine)
)
Metadata create_all sees multiple definitions of the same trigger?
Thanks
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.