Skip to content

Commit

Permalink
Merge pull request #5 from spapa013/main
Browse files Browse the repository at this point in the history
modules load dependencies on import and replaces `register_adapters`
  • Loading branch information
spapa013 authored Dec 1, 2021
2 parents c42ef40 + 5599648 commit 1f66d42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ def register_externals(schema_name:str):
config_utils.register_externals(external_stores)


def register_adapters(schema_name:str, context=None):
"""
Imports the adapters for a schema_name into the global namespace.
"""
adapter_objects = config_mapping[SCHEMAS(schema_name)]["adapters"]

if adapter_objects is not None:
config_utils.register_adapters(adapter_objects, context=context)


def register_bases(schema_name:str, module):
"""
Maps base classes to DataJoint tables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
config.register_externals(schema_obj)

schema = dj.schema(schema_obj.value)
schema.spawn_missing_classes()
schema.spawn_missing_classes()
schema.connection.dependencies.load()

0 comments on commit 1f66d42

Please sign in to comment.