asyncorm.application package¶
Subpackages¶
Submodules¶
asyncorm.application.configure module¶
-
class
asyncorm.application.configure.
OrmApp
[source]¶ Bases:
object
-
configure
(config)[source]¶ Configures the system: get all the models declared set the database configured and add the loop
Then the database backend is configured, and set to all the models previously declared and then we finish the models configurations using models_configure(): will take care of the inverse relations for foreignkeys and many2many
-
get_model
(model_name)[source]¶ Get the model that is defined in the ORM.
Parameters: model_name (str) – name of the model to get
Raises: - AsyncOrmAppError – When there is no model declared
- AsyncOrmModelError – When model_name is not in the correct format
- AsyncOrmModelDoesNotExist – When the model does not exist
Returns: model requested
Return type:
-
-
asyncorm.application.configure.
configure_orm
(config=None, loop=None)[source]¶ Configure the orm
Parameters: - config – Configuration information that can be provided. Defaults to None, that means it will get the configuration from the .ini file in the base directory.
- config – dict
- loop – The loop your application will be working on. Defaults to None, means it will get the loop using asyncio.get_event_loop
- loop – asyncio.loop
Returns: orm configured
Return type:
-
asyncorm.application.configure.
get_model
(model_name)[source]¶ Wrapper around the OrmApp class method.
Parameters: model_name (str) – name of the model to get
Raises: - AsyncOrmAppError – When there is no model declared
- AsyncOrmModelError – When model_name is not in the correct format
- AsyncOrmModelDoesNotExist – When the model does not exist
Returns: model requested
Return type:
Module contents¶
-
asyncorm.application.
configure_orm
(config=None, loop=None)[source]¶ Configure the orm
Parameters: - config – Configuration information that can be provided. Defaults to None, that means it will get the configuration from the .ini file in the base directory.
- config – dict
- loop – The loop your application will be working on. Defaults to None, means it will get the loop using asyncio.get_event_loop
- loop – asyncio.loop
Returns: orm configured
Return type: