Skip to content

AmsdalManager

AmsdalManager is a toplevel class to manage your application, connections, integrations, data and migrations:

  • build
  • apply migrations
  • initiate connections
  • teardown

amsdal.manager.AmsdalManager

Bases: amsdal.mixins.class_versions_mixin.ClassVersionsMixin

Manages the AMSDAL framework components and operations.

This class is responsible for initializing, setting up, and managing various components of the AMSDAL framework, including connections, data management, schema management, and authentication. It also provides methods for building and tearing down the framework.

__init__ method descriptor

__init__(*, raise_on_new_signup=False)

Initializes all sub managers. Reads the configuration.

Returns: None

is_authenticated property

is_authenticated

Indicates if the AMSDAL license authentication process has been passed.

This property returns a boolean value indicating whether the AMSDAL license authentication process has been successfully completed.

Returns: bool: True if authenticated, False otherwise.

pre_setup method descriptor

pre_setup()

Initiates models root path and adds it into sys.path.

This method initializes the class manager models modules and sets up the models root path as specified in the settings. It ensures that the models root path is added to the system path for proper module resolution.

Returns: None

setup method descriptor

setup()

Initiates models root path and the connections.

This method sets up the AMSDAL framework by initializing the models root path and establishing connections. It ensures that the setup process is only performed once.

Raises: AmsdalRuntimeError: If the AMSDAL manager is already set up.

Returns: None

authenticate method descriptor

authenticate()

Run AMSDAL license authentication process.

This method runs the AMSDAL license authentication process and sets the authentication status accordingly.

Returns: None

apply_fixtures method descriptor

apply_fixtures()

Loads and applies fixtures defined in your application.

This method loads the fixtures from the specified path and applies them to the AMSDAL framework. It uses the FixturesManager to manage the loading and application of the fixtures.

Returns: None

teardown method descriptor

teardown()

Clean up everything on the application exit.

This method performs a cleanup of all components managed by the AMSDAL framework when the application exits. It disconnects and invalidates connections, clears caches, and resets the setup status.

Raises: AmsdalRuntimeError: If the AMSDAL manager is not set up.

Returns: None