asyncorm.application package

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

create_db()[source]

We create all tables for each of the declared models

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:
Returns:

model requested

Return type:

asyncorm.models.Model

models_configure()[source]
set_model_orm()[source]
sync_db()[source]
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:

OrmApp

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:
Returns:

model requested

Return type:

asyncorm.models.Model

asyncorm.application.configure.parse_config(config_file)[source]

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:

OrmApp