API¶
Main module for flask_arango_orm
-
class
flask_arango_orm.arango.
ArangoORM
(app=None)[source]¶ Flask extension for integrating the arango_orm package
-
__init__
(app=None)[source]¶ Constructor
If a flask app instance is passed as an argument,
init_app
is run as well.Parameters: app (flask.Flask) – Flask app instance
-
__weakref__
¶ list of weak references to the object (if defined)
-
connect
()[source]¶ Sets up the connection to the arangodb database
Uses app configuration for setup, utilizing the following:
- ARANGODB_DATABASE
- ARANGODB_USER
- ARANGODB_PASSWORD
- ARANGODB_HOST
- ARANGODB_CLUSTER
- ARANGODB_HOST_POOL
If ARANGODB_CLUSTER is True, then the host configuration is taken from ARANGODB_HOST_POOL, otherwise ARANGODB_HOST is used.
Returns: Connection to arangodb Return type: arango_orm.Database
-
connection
¶ Property for storing and retrieving the database connection
Stores the database connection in the top of the Flask application context stack,
flask._app_ctx_stack
. If a connection does not currently exist,connect()
is called.Returns: ArangoDB connection Return type: arango_orm.Database
-
init_app
(app)[source]¶ Initializes ArangoORM for use with the passed app instance
Sets up the following defaults:
- ARANGODB_CLUSTER = False
- ARANGODB_HOST = (‘http’, ‘127.0.0.1’, 8529)
This should be useful for most development setups
Parameters: app (flask.Flask) – Flask app instance Returns:
-