def clear_mapper(m): """Remove the given mapper from the storage of mappers. When a new mapper is created for the previous mapper's class, it will be used as that classes' new primary mapper. """ del mapper_registry[m.class_key] attribute_manager.reset_class_managed(m.class_) if hasattr(m.class_, 'c'): del m.class_.c m.class_key.dispose()
def clear_mapper(m): """Remove the given mapper from the storage of mappers. When a new mapper is created for the previous mapper's class, it will be used as that classes' new primary mapper. """ del mapper_registry[m.class_key] attribute_manager.reset_class_managed(m.class_) if hasattr(m.class_, 'c'): del m.class_.c m.class_key.dispose()
def clear_mappers(): """Remove all mappers that have been created thus far. When new mappers are created, they will be assigned to their classes as their primary mapper. """ for mapper in mapper_registry.values(): attribute_manager.reset_class_managed(mapper.class_) if hasattr(mapper.class_, 'c'): del mapper.class_.c mapper_registry.clear() sautil.ArgSingleton.instances.clear()
def clear_mappers(): """Remove all mappers that have been created thus far. When new mappers are created, they will be assigned to their classes as their primary mapper. """ for mapper in mapper_registry.values(): attribute_manager.reset_class_managed(mapper.class_) if hasattr(mapper.class_, 'c'): del mapper.class_.c mapper_registry.clear() sautil.ArgSingleton.instances.clear()
def clear_mapper(m): """Remove the given mapper from the storage of mappers. When a new mapper is created for the previous mapper's class, it will be used as that classes' new primary mapper. """ mapperlib._COMPILE_MUTEX.acquire() try: del mapper_registry[m.class_key] attribute_manager.reset_class_managed(m.class_) if hasattr(m.class_, "c"): del m.class_.c m.class_key.dispose() finally: mapperlib._COMPILE_MUTEX.release()
def clear_mappers(): """Remove all mappers that have been created thus far. When new mappers are created, they will be assigned to their classes as their primary mapper. """ mapperlib._COMPILE_MUTEX.acquire() try: for mapper in mapper_registry.values(): attribute_manager.reset_class_managed(mapper.class_) if hasattr(mapper.class_, "c"): del mapper.class_.c mapper_registry.clear() # TODO: either dont use ArgSingleton, or # find a way to clear only ClassKey instances from it sautil.ArgSingleton.instances.clear() finally: mapperlib._COMPILE_MUTEX.release()