from mara_db import config, views, cli

MARA_CONFIG_MODULES = [config]

MARA_NAVIGATION_ENTRY_FNS = [views.navigation_entry]

MARA_ACL_RESOURCES = [views.acl_resource]

MARA_FLASK_BLUEPRINTS = [views.blueprint]

MARA_CLICK_COMMANDS = [cli.migrate]

"""Make the functionalities of this package auto-discoverable by mara-app"""


def MARA_CONFIG_MODULES():
    from . import config
    return [config]


def MARA_FLASK_BLUEPRINTS():
    from . import views
    return [views.blueprint]


def MARA_AUTOMIGRATE_SQLALCHEMY_MODELS():
    return []


def MARA_ACL_RESOURCES():
    from . import views
    return {'DB Schema': views.acl_resource}


def MARA_CLICK_COMMANDS():
    from . import cli
    return [cli.migrate]


def MARA_NAVIGATION_ENTRIES():
    from . import views
    return {'DB Schema': views.navigation_entry()}

Change MARA_XXX variables to functions to delay importing of imports (requires updating mara-app to 2.0.0)
Change MARA_XXX variables to functions to delay importing of imports (requires updating mara-app to 2.0.0)

- from mara_db import config, views, cli
+ """Make the functionalities of this package auto-discoverable by mara-app"""
  
- MARA_CONFIG_MODULES = [config]
  
- MARA_NAVIGATION_ENTRY_FNS = [views.navigation_entry]
+ def MARA_CONFIG_MODULES():
+     from . import config
+     return [config]
  
- MARA_ACL_RESOURCES = [views.acl_resource]
  
- MARA_FLASK_BLUEPRINTS = [views.blueprint]
+ def MARA_FLASK_BLUEPRINTS():
+     from . import views
+     return [views.blueprint]
  
- MARA_CLICK_COMMANDS = [cli.migrate]
  
+ def MARA_AUTOMIGRATE_SQLALCHEMY_MODELS():
+     return []
+ 
+ 
+ def MARA_ACL_RESOURCES():
+     from . import views
+     return {'DB Schema': views.acl_resource}
+ 
+ 
+ def MARA_CLICK_COMMANDS():
+     from . import cli
+     return [cli.migrate]
+ 
+ 
+ def MARA_NAVIGATION_ENTRIES():
+     from . import views
+     return {'DB Schema': views.navigation_entry()}
+ 
Change MARA_XXX variables to functions to delay importing of imports (requires updating mara-app to 2.0.0)
## Code Before:
from mara_db import config, views, cli

MARA_CONFIG_MODULES = [config]

MARA_NAVIGATION_ENTRY_FNS = [views.navigation_entry]

MARA_ACL_RESOURCES = [views.acl_resource]

MARA_FLASK_BLUEPRINTS = [views.blueprint]

MARA_CLICK_COMMANDS = [cli.migrate]

## Instruction:
Change MARA_XXX variables to functions to delay importing of imports (requires updating mara-app to 2.0.0)
## Code After:
"""Make the functionalities of this package auto-discoverable by mara-app"""


def MARA_CONFIG_MODULES():
    from . import config
    return [config]


def MARA_FLASK_BLUEPRINTS():
    from . import views
    return [views.blueprint]


def MARA_AUTOMIGRATE_SQLALCHEMY_MODELS():
    return []


def MARA_ACL_RESOURCES():
    from . import views
    return {'DB Schema': views.acl_resource}


def MARA_CLICK_COMMANDS():
    from . import cli
    return [cli.migrate]


def MARA_NAVIGATION_ENTRIES():
    from . import views
    return {'DB Schema': views.navigation_entry()}
