Module ImportFrom alias ImportFrom alias Import alias identifier ImportFrom alias Import alias Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults BinOpMult BinOpMult BinOpMult Num Num Num Num BinOpMult BinOpMult Num Num Num Num Num vararg kwarg body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Dict kwarg body Expr Str If UnaryOpNot NameLoad body Raise Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Raise Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Expr Str If UnaryOpNot NameLoad body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BoolOpAnd NameLoad Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd NameLoad BoolOpOr UnaryOpNot NameLoad BoolOpAnd NameLoad UnaryOpNot Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str body Raise Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpAdd Call NameLoad BoolOpOr BoolOpAnd NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore BinOpAdd Call NameLoad BoolOpOr BoolOpAnd NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareLt SubscriptLoad NameLoad Index Str NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr UnaryOpNot NameLoad UnaryOpNot Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str body Raise Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad NameLoad Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore Call NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list decorator_list ImportFrom alias alias Expr Call NameLoad Str keyword Str keyword Str keyword Str Expr Call NameLoad Str keyword Str keyword Str Expr Call NameLoad Str keyword Num keyword Str Expr Call NameLoad Str keyword NameLoad keyword Str Expr Call NameLoad Str keyword NameLoad keyword Str Expr Call NameLoad Str keyword NameLoad keyword Str Expr Call NameLoad Str keyword NameLoad keyword Str Expr Call NameLoad Str keyword NameLoad keyword Str Expr Call NameLoad Str keyword NameLoad keyword Str Expr Call NameLoad Str keyword NameLoad keyword Str Expr Call NameLoad Str keyword NameLoad keyword Num keyword Str Expr Call NameLoad Str keyword NameLoad keyword Num keyword Str Expr Call NameLoad Str keyword Str keyword Str Expr Call NameLoad Str keyword Num keyword Str Expr Call NameLoad Str keyword BinOpMult BinOpMult BinOpMult Num Num Num Num keyword Str Expr Call NameLoad Str keyword BinOpMult BinOpMult Num Num Num keyword Str Expr Call NameLoad Str keyword Num keyword Str Expr Call NameLoad Str keyword Num keyword Str FunctionDef arguments args defaults body Expr Str If CompareEq AttributeLoad NameLoad attr Str body ImportFrom alias Return Call NameLoad AttributeLoad NameLoad attr BoolOpOr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body ImportFrom alias Return Call NameLoad AttributeLoad NameLoad attr BoolOpOr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body ImportFrom alias Return Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr BoolOpOr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body ImportFrom alias Return Call NameLoad AttributeLoad NameLoad attr BoolOpOr AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body ImportFrom alias Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse ImportFrom alias Return Call NameLoad decorator_list
N/A toto.exceptions * toto.session * N/A toto.secret secret time time N/A random N/A string toto.tasks InstancePool DBConnection N/A object N/A N/A Toto uses subclasses of DBConnection to support session and account storage as well as general
    access to the backing database. Usually, direct access to the underlying database driver will
    be available via the ``DBConnection.db`` property.

    Currently, toto provides the following ``DBConnection`` drivers:

    * ``toto.mongodbconnection.MongoDBConnection``
    * ``toto.mysqldbconnection.MySQLdbConnection``
    * ``toto.postgresconnection.PostgresConnection``
    * ``toto.redisconnection.RedisConnection``
    * ``toto.jsondbconnection.JSONConnection`` (For debugging only)
   N/A _session_cache None __init__ N/A N/A self session_ttl anon_session_ttl session_renew anon_session_renew N/A N/A N/A N/A 24 60 60 365 N/A N/A 24 60 60 0 0 args kwargs N/A N/A N/A self session_ttl session_ttl N/A N/A self anon_session_ttl N/A anon_session_ttl N/A self session_ttl N/A N/A self session_renew N/A session_renew N/A self session_ttl N/A N/A self anon_session_renew N/A anon_session_renew N/A self anon_session_ttl N/A create_account N/A N/A self user_id password additional_values N/A N/A values N/A N/A Create an account for the given ``user_id`` and ``password``. Optionally set additional account
      values by passing them as keyword arguments (the ``additional_values`` parameter is deprecated).

      Note: if your database uses a predefined schema, make sure to create the appropriate columns
      before passing additional arguments to ``create_account``.
     N/A N/A user_id N/A N/A N/A TotoException ERROR_INVALID_USER_ID Invalid user ID. N/A user_id N/A N/A user_id lower N/A account N/A N/A self _get_account user_id N/A account N/A N/A N/A TotoException ERROR_USER_ID_EXISTS User ID already in use. N/A N/A N/A values update additional_values N/A N/A values N/A user_id user_id N/A N/A values N/A password N/A N/A secret password_hash password N/A N/A N/A self _store_account user_id values N/A create_session N/A N/A self user_id password verify_password key N/A None None True None N/A N/A Create a new session for the account with the given ``user_id`` and ``password``, or an anonymous
      session if anonymous sessions are enabled. This method returns a subclass of ``TotoSession``
      designed for the current backing database. Pass ``verify_password=False`` to create a session
      without checking the password. This feature can be used to implement alternative authentication
      methods like Facebook, Twitter or Google+.
     N/A N/A user_id N/A N/A user_id N/A user_id N/A N/A user_id lower N/A account N/A user_id N/A N/A self _get_account user_id N/A N/A user_id N/A N/A account N/A verify_password N/A N/A N/A secret verify_password password N/A account N/A password N/A N/A N/A TotoException ERROR_USER_NOT_FOUND Invalid user ID or password N/A session_id N/A N/A TotoSession generate_id N/A expires N/A N/A time N/A N/A user_id N/A self session_ttl N/A self anon_session_ttl N/A session_data N/A user_id expires session_id user_id expires session_id N/A key N/A N/A N/A session_data N/A key key N/A N/A N/A self _prepare_session account session_data N/A N/A N/A N/A self _cache_session_data session_data N/A N/A N/A N/A self _store_session session_id session_data N/A session N/A N/A self _instantiate_session session_data N/A self _session_cache N/A session N/A retrieve_session N/A N/A self session_id N/A N/A N/A Retrieve an existing session with the given ``session_id``. This method returns a
    subclass of ``TotoSession`` designed for the current backing database.

    The use of HTTPS is strongly recommended for any communication involving sensitive information.
     N/A session_data N/A N/A self _load_session_data session_id N/A N/A session_data N/A N/A None N/A user_id N/A session_data N/A user_id N/A expires N/A N/A time N/A N/A user_id N/A self session_renew N/A self anon_session_renew N/A N/A N/A session_data N/A expires expires N/A N/A N/A session_data N/A expires expires N/A N/A N/A N/A self _cache_session_data session_data N/A N/A N/A N/A self _update_expiry session_id session_data N/A session N/A N/A self _instantiate_session session_data N/A self _session_cache N/A session N/A change_password N/A N/A self user_id password new_password N/A N/A N/A Updates the password for the account with the given ``user_id`` and ``password`` to match
    ``new_password`` for all future requests.
     N/A user_id N/A N/A user_id lower N/A account N/A N/A self _get_account user_id N/A N/A N/A account N/A N/A N/A secret verify_password password N/A account N/A password N/A N/A N/A TotoException ERROR_USER_NOT_FOUND Invalid user ID or password N/A N/A N/A self _update_password user_id account N/A N/A secret password_hash new_password N/A generate_password N/A N/A self user_id N/A N/A N/A Generates a new password for the account with the given ``user_id`` and makes it active
    for all future requests. The new password will be returned. This method is designed to
    support "forgot password" functionality.
     N/A user_id N/A N/A user_id lower N/A account N/A N/A self _get_account user_id N/A N/A account N/A N/A N/A TotoException ERROR_USER_NOT_FOUND Invalid user ID N/A pass_chars N/A N/A string ascii_letters N/A string digits N/A new_password N/A N/A join N/A N/A N/A random choice pass_chars N/A x N/A xrange 10 N/A N/A N/A self _update_password user_id account N/A N/A secret password_hash new_password N/A new_password N/A remove_session N/A N/A self session_id N/A N/A N/A Invalidate the session with the given ``session_id``.
     N/A N/A self _session_cache N/A N/A N/A N/A N/A self _session_cache remove_session session_id N/A N/A N/A N/A self _remove_session session_id N/A _remove_session N/A N/A self session_id N/A N/A N/A Called by ``DBConnection.remove_session`` to invalidate the specified session when no session cache is in use.
     N/A N/A NotImplementedError N/A clear_sessions N/A N/A self user_id N/A N/A N/A If implemented, invalidates all sessions tied to the account with the given ``user_id``.
     N/A N/A set_session_cache N/A N/A self session_cache N/A N/A N/A Optionally set an instance of ``TotoSessionCache`` that will be used to store sessions separately from
    this database.
     N/A N/A self _session_cache session_cache N/A _load_session_data N/A N/A self session_id N/A N/A N/A Called by ``DBConnection.retrieve_session``. Will attempt to load data from an associated ``TotoSessionCache``.
    If no ``TotoSessionCache`` is associated with the current instance, the result of ``self._load_uncached_data(session_id)``
    is returned.
     N/A N/A self _session_cache N/A N/A N/A N/A N/A self _session_cache load_session session_id N/A N/A N/A self _load_uncached_data session_id N/A _load_uncached_data N/A N/A self session_id N/A N/A N/A Load a session data ``dict`` from the local database. Called by default and if no ``TotoSessionCache`` has been
    associated with the current instance of ``DBConnection``.
     N/A N/A NotImplementedError N/A _cache_session_data N/A N/A self session_data N/A N/A N/A Called by ``DBConnection.create_session`` and by ``DBConnection.retrieve_session`` if there is a change in ``TotoSession.expires``.
    Returns ``True`` if the session has been written to an associated ``TotoSessionCache``, ``False`` otherwise.
     N/A N/A self _session_cache N/A N/A updated_session_id N/A N/A N/A self _session_cache store_session session_data N/A updated_session_id N/A N/A N/A session_data N/A session_id updated_session_id N/A True N/A False N/A _store_session N/A N/A self session_id session_data N/A N/A N/A Called by ``DBConnection.create_session``, and by ``DBConnection.retrieve_session`` if there is a change in ``TotoSession.expires``.
    Will not be called if a session cache has been attached to the ``DBConnection``.
     N/A N/A NotImplementedError N/A _update_expiry N/A N/A self session_id session_data N/A N/A N/A Called by ``DBConnection.retrieve_session`` if there is a change in ``TotoSession.expires`` to allow optional efficient updates.
    If not implemented, ``self._store_session`` will be called.
     N/A N/A N/A self _store_session session_id session_data N/A _update_password N/A N/A self user_id hashed_password N/A N/A N/A Called by ``DBConnection.change_password`` and ``DBConnection.generate_password``.
     N/A N/A NotImplementedError N/A _instantiate_session N/A N/A self session_data session_cache N/A N/A N/A Called by ``DBConnection.create_session`` and by ``DBConnection.retrieve_session`` to actually instantiate a ``TotoSession``
    instance. Must return a new ``TotoSession``.
     N/A N/A NotImplementedError N/A _get_account N/A N/A self user_id N/A N/A N/A Called by ``DBConnection.create_session`` if ``verify_password=True`` and must return a dictionry containing
    at least the pair ``'password':<hashed_password``.
     N/A N/A NotImplementedError N/A _prepare_session N/A N/A self account session_data N/A N/A N/A Called by ``DBConnection.create_session`` before the session is written to the database to allow for the
    addition of any extra data that may be needed by the ``subclass.TotoSession`` implementation.
     N/A N/A _store_account N/A N/A self user_id values N/A N/A N/A Must be implemented in subclasses to persist new accounts to the database. Values is a dictionary
    that will contain, at a minimum, ``user_id`` and ``password``. ``password`` will be the hashed password
    passed to ``self.create_account()``.
     N/A N/A NotImplementedError N/A N/A tornado.options define options N/A N/A define database metavar mysql|mongodb|redis|postgres|json|none default none help the database driver to use N/A N/A define db_host default localhost help The host to use for database connections. N/A N/A define db_port default 0 help The port to use for database connections. Leave this at zero to use the default for the selected database type N/A N/A define mysql_database type str help Main MySQL schema name N/A N/A define mysql_user type str help Main MySQL user N/A N/A define mysql_password type str help Main MySQL user password N/A N/A define mysql_uuid_account_id default False help Use binary(16) UUIDs for account_id in MySQL databases instead of int(8) unsigned auto_increment. UUID(bytes=handler.session.account_id) can be used to get a UUID representing the account_id. N/A N/A define postgres_database type str help Main Postgres database name N/A N/A define postgres_user type str help Main Postgres user N/A N/A define postgres_password type str help Main Postgres user password N/A N/A define postgres_min_connections type int default 1 help The minimum number of connections to keep in the Postgres connection pool N/A N/A define postgres_max_connections type int default 100 help The maximum number of connections to keep in the Postgres connection pool N/A N/A define mongodb_database default toto_server help MongoDB database N/A N/A define redis_database default 0 help Redis DB N/A N/A define session_ttl default N/A N/A N/A 24 60 60 365 help The number of seconds after creation a session should expire N/A N/A define anon_session_ttl default N/A N/A 24 60 60 help The number of seconds after creation an anonymous session should expire N/A N/A define session_renew default 0 help The number of seconds before a session expires that it should be renewed, or zero to renew on every request N/A N/A define anon_session_renew default 0 help The number of seconds before an anonymous session expires that it should be renewed, or zero to renew on every request configured_connection N/A N/A N/A N/A N/A Returns a new database connection based on the configuration options
     N/A N/A N/A options database mongodb N/A mongodbconnection MongoDBConnection N/A N/A MongoDBConnection N/A options db_host N/A N/A options db_port 27017 N/A options mongodb_database session_ttl N/A options session_ttl anon_session_ttl N/A options anon_session_ttl session_renew N/A options session_renew anon_session_renew N/A options anon_session_renew N/A N/A N/A N/A options database redis N/A redisconnection RedisConnection N/A N/A RedisConnection N/A options db_host N/A N/A options db_port 6379 N/A options redis_database session_ttl N/A options session_ttl anon_session_ttl N/A options anon_session_ttl session_renew N/A options session_renew anon_session_renew N/A options anon_session_renew N/A N/A N/A N/A options database mysql N/A mysqldbconnection MySQLdbConnection N/A N/A MySQLdbConnection N/A %s:%s N/A N/A options db_host N/A N/A options db_port 3306 N/A options mysql_database N/A options mysql_user N/A options mysql_password session_ttl N/A options session_ttl anon_session_ttl N/A options anon_session_ttl session_renew N/A options session_renew anon_session_renew N/A options anon_session_renew uuid_account_id N/A options mysql_uuid_account_id N/A N/A N/A N/A options database postgres N/A postgresconnection PostgresConnection N/A N/A PostgresConnection N/A options db_host N/A N/A options db_port 5432 N/A options postgres_database N/A options postgres_user N/A options postgres_password session_ttl N/A options session_ttl anon_session_ttl N/A options anon_session_ttl session_renew N/A options session_renew anon_session_renew N/A options anon_session_renew min_connections N/A options postgres_min_connections max_connections N/A options postgres_max_connections N/A N/A N/A N/A options database json N/A jsondbconnection JSONConnection N/A N/A InstancePool N/A JSONConnection N/A options db_host N/A options db_port session_ttl N/A options session_ttl anon_session_ttl N/A options anon_session_ttl session_renew N/A options session_renew anon_session_renew N/A options anon_session_renew N/A fakeconnection FakeConnection N/A N/A FakeConnection N/A