Module ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias ImportFrom alias Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body If UnaryOpNot SubscriptLoad NameLoad Index Str body Continue Expr Call AttributeLoad NameLoad attr Call NameLoad TupleLoad TupleLoad keyword SubscriptLoad NameLoad Index Str For NameStore Call AttributeLoad NameLoad attr NameLoad body If Call NameLoad SubscriptLoad NameLoad Index Str NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TryExcept body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr Raise decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body ImportFrom alias Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Return Call NameLoad Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam defaults body For NameStore AttributeLoad NameLoad attr body If NameLoad body Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad orelse Expr Call NameLoad BinOpAdd Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword ListLoad NameLoad decorator_list If Call NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad Str Expr Call NameLoad AttributeLoad NameLoad attr orelse For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn NameLoad TupleLoad NameLoad NameLoad body Continue Expr Call NameLoad Call AttributeLoad Str attr NameLoad Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Str If CompareNotEq Call AttributeLoad Call AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs NameLoad NameLoad body Expr Call NameLoad Str orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call NameLoad NameLoad Expr Call NameLoad Str decorator_list If Call NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad Str keyword Str Expr Call NameLoad AttributeLoad NameLoad attr orelse For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn NameLoad TupleLoad NameLoad NameLoad body Continue Expr Call NameLoad Call AttributeLoad Str attr NameLoad keyword Str Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore NameStore NameLoad If NameLoad body If Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad orelse If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num orelse Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body If CompareIs NameLoad NameLoad body For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad orelse TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list If Call NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad AttributeLoad NameLoad attr orelse For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn NameLoad TupleLoad NameLoad NameLoad body Continue Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad Num If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call NameLoad Call AttributeLoad Str attr NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list
N/A __future__ print_function N/A sys sqlalchemy create_engine sqlalchemy.types SchemaType sqlalchemy.engine reflection sqlalchemy.schema MetaData Table DropTable ForeignKeyConstraint DropConstraint base Cli N/A __all__ N/A Sqla drop_everything N/A N/A engine N/A N/A N/A Droping all tables and custom types (enums) using `engine`.
    Taken from http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DropEverything

    This method is more robust than `metadata.drop_all(engine)`. B.c. when
    you change a table or a type name, `drop_all` does not consider the old one.
    Thus, DB holds some unused entities. N/A conn N/A N/A engine connect N/A trans N/A N/A conn begin N/A inspector N/A N/A N/A reflection Inspector from_engine engine N/A metadata N/A MetaData N/A tbs N/A N/A all_fks N/A N/A types N/A N/A table_name N/A N/A inspector get_table_names N/A N/A fks N/A N/A fk N/A N/A inspector get_foreign_keys table_name N/A N/A N/A N/A fk N/A name N/A N/A N/A N/A N/A fks append N/A ForeignKeyConstraint N/A N/A name N/A fk N/A name N/A col N/A N/A inspector get_columns table_name N/A N/A N/A isinstance N/A col N/A type SchemaType N/A N/A N/A N/A types append N/A col N/A type N/A t N/A Table table_name metadata fks N/A N/A N/A tbs append t N/A N/A N/A all_fks extend fks N/A N/A N/A fkc all_fks N/A N/A N/A N/A conn execute N/A DropConstraint fkc N/A table tbs N/A N/A N/A N/A conn execute N/A DropTable table N/A custom_type types N/A N/A N/A N/A custom_type drop conn N/A N/A N/A trans commit N/A N/A N/A N/A N/A N/A trans rollback N/A N/A Sqla N/A Cli N/A N/A 
    SQLAlchemy database handling

    :param session_maker: sqlalchemy session maker function
    :param metadata: sqlalchemy metadata object or dictionary mapping names to
        metadata objects for multi-DB configuration to deal with
    :param initial: a function acceptind sqlalchemy session and filling-in
        a database with default initial data
    :param dict generators: a dictionary with generator functions. Generator
        functions should fill database with "lorem ipsum" data.
        They accept sqlalchemy session and a cnumber of objects to be created.
     __init__ N/A N/A self session_maker metadata initial generators N/A None None N/A N/A N/A self session N/A session_maker N/A N/A self metadata metadata N/A N/A self initial initial N/A N/A self generators N/A generators N/A N/A _schema N/A N/A self table N/A N/A sqlalchemy.schema CreateTable N/A engine N/A N/A N/A self session get_bind clause table N/A N/A str N/A CreateTable table bind engine N/A command_create_tables N/A N/A self meta_name verbose N/A None False N/A N/A 
        Create tables according sqlalchemy data model.

        Is not a complex migration tool like alembic, just creates tables that
        does not exist::

            ./manage.py sqla:create_tables [--verbose] [meta_name]
         _create_metadata_tables N/A N/A metadata N/A N/A N/A table N/A metadata sorted_tables N/A N/A verbose N/A N/A N/A print N/A N/A self _schema table N/A N/A N/A print N/A N/A table name N/A engine N/A N/A N/A self session get_bind clause table N/A N/A N/A metadata create_all bind engine tables N/A table N/A N/A N/A isinstance N/A self metadata MetaData N/A N/A N/A print Creating tables... N/A N/A _create_metadata_tables N/A self metadata N/A N/A N/A current_meta_name metadata N/A N/A N/A self metadata items N/A N/A N/A meta_name N/A current_meta_name None N/A N/A N/A N/A print N/A N/A Creating tables for {}... format current_meta_name N/A N/A _create_metadata_tables metadata N/A command_drop_tables N/A N/A self meta_name N/A None N/A N/A 
        Drops all tables without dropping a database::

            ./manage.py sqla:drop_tables [meta_name]
         N/A answer N/A raw_input All data will lost. Are you sure? [y/N]  N/A N/A N/A N/A N/A N/A answer strip lower y N/A N/A N/A N/A sys exit Interrupted _drop_metadata_tables N/A N/A metadata N/A N/A N/A table N/A next N/A N/A N/A metadata tables itervalues None N/A N/A table None N/A N/A N/A print Failed to find engine N/A N/A engine N/A N/A N/A self session get_bind clause table N/A N/A drop_everything engine N/A N/A print Done N/A N/A N/A isinstance N/A self metadata MetaData N/A N/A N/A print Droping tables...  end N/A N/A _drop_metadata_tables N/A self metadata N/A N/A N/A current_meta_name metadata N/A N/A N/A self metadata items N/A N/A N/A meta_name N/A current_meta_name None N/A N/A N/A N/A print N/A N/A Droping tables for {}...  format current_meta_name end N/A N/A _drop_metadata_tables metadata N/A command_init N/A N/A self N/A N/A N/A 
        Runs init function::

            ./manage.py sqla:init
         N/A N/A self initial N/A N/A N/A N/A self initial N/A self session N/A command_reset N/A N/A self N/A N/A N/A 
        Drops all tables, creates tables and runs init function::

            ./manage.py sqla:reset
         N/A N/A N/A self command_drop_tables N/A N/A N/A self command_create_tables N/A N/A N/A self command_init N/A command_schema N/A N/A self name N/A None N/A N/A 
        Prints current database schema (according sqlalchemy database model)::

            ./manage.py sqla:schema [name]
         N/A meta_name table_name None N/A name N/A N/A N/A isinstance N/A self metadata MetaData N/A N/A table_name name N/A N/A N/A . name N/A N/A N/A meta_name table_name N/A N/A name split . 1 N/A N/A meta_name name _print_metadata_schema N/A N/A metadata N/A N/A N/A N/A table_name None N/A N/A table N/A metadata sorted_tables N/A N/A N/A print N/A N/A self _schema table N/A N/A N/A N/A table N/A N/A metadata tables N/A table_name N/A N/A N/A KeyError N/A N/A N/A N/A sys exit N/A N/A Table {} is not found format name N/A N/A print N/A N/A self _schema table N/A N/A N/A isinstance N/A self metadata MetaData N/A N/A N/A _print_metadata_schema N/A self metadata N/A N/A N/A current_meta_name metadata N/A N/A N/A self metadata items N/A N/A N/A meta_name N/A current_meta_name None N/A N/A N/A N/A _print_metadata_schema metadata N/A command_gen N/A N/A self N/A names N/A N/A 
        Runs generator functions.

        Run `docs` generator function::

            ./manage.py sqla:gen docs

        Run `docs` generator function with `count=10`::

            ./manage.py sqla:gen docs:10
         N/A N/A names N/A N/A N/A N/A sys exit Please provide generator names N/A name names N/A N/A N/A name count N/A name 0 N/A N/A : name N/A N/A N/A name count N/A N/A name split : 1 N/A count N/A int count N/A create N/A N/A self generators N/A name N/A N/A print N/A N/A Generating `{0}` count={1} format name count N/A N/A create N/A self session count N/A N/A N/A N/A self session commit N/A N/A