def init(file_path, url, engine_options={}, create_tables=False): """Connect mappings to the database""" # Create the database engine engine = build_engine(url, engine_options) # Connect the metadata to the database. metadata.bind = engine result = ModelMapping([galaxy.webapps.tool_shed.model], engine=engine) if create_tables: metadata.create_all() result.create_tables = create_tables # Load local tool shed security policy result.security_agent = CommunityRBACAgent(result) result.shed_counter = shed_statistics.ShedCounter(result) result.hgweb_config_manager = galaxy.webapps.tool_shed.util.hgweb_config.HgWebConfigManager() return result
def init( file_path, url, engine_options={}, create_tables=False ): """Connect mappings to the database""" # Create the database engine engine = build_engine( url, engine_options ) # Connect the metadata to the database. metadata.bind = engine result = ModelMapping([galaxy.webapps.tool_shed.model], engine=engine) if create_tables: metadata.create_all() result.create_tables = create_tables # Load local tool shed security policy result.security_agent = CommunityRBACAgent( result ) result.shed_counter = shed_statistics.ShedCounter( result ) result.hgweb_config_manager = galaxy.webapps.tool_shed.util.hgweb_config.HgWebConfigManager() return result