X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/blobdiff_plain/d124ab5c80b03da46b464128a6e743376d26e5ff..be9ccbda3c523e5d1ab3845734943fe55e9fac36:/sipb_xen_database/models.py diff --git a/sipb_xen_database/models.py b/sipb_xen_database/models.py index e34051b..b075886 100644 --- a/sipb_xen_database/models.py +++ b/sipb_xen_database/models.py @@ -5,6 +5,7 @@ from sqlalchemy.ext.assignmapper import assign_mapper __all__ = ['meta', 'ctx', + 'clear_cache', 'machine_table', 'machine_access_table', 'nic_table', @@ -96,3 +97,11 @@ assign_mapper(ctx, NIC, nic_table) assign_mapper(ctx, Disk, disk_table) assign_mapper(ctx, Type, types_table) assign_mapper(ctx, CDROM, cdroms_table) + +def clear_cache(): + """Clear sqlalchemy's cache. + + This _seems_ to be the way; it works, but the docs don't mention + it. Why is this so obscure?""" + + ctx.registry.clear()