Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias alias FunctionDef arguments args NameParam defaults body Expr Str If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq SubscriptLoad NameLoad Index Str Str body Raise Call NameLoad Str If CompareIsNot SubscriptLoad NameLoad Index Str NameLoad body Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Delete SubscriptDel NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIs NameLoad NameLoad body Return ListLoad If NameLoad body Return ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Return ListComp Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad comprehension NameStore NameLoad CompareIsNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareEq NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareEq Call NameLoad NameLoad Num body If CompareEq Call NameLoad SubscriptLoad NameLoad Index Num Num body Assign NameStore SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index Num attr Index Num orelse Assign NameStore SubscriptLoad NameLoad Index Num Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list decorator_list
N/A N/A      
    flask_moresql
    =============
    
    A thin layer of glue between PostgreSQL stored procedures and Flask web
    applications. 
       
    :copyright: (C) 2012 by Emanuele Rocca.
    :license: BSD, see LICENSE for more details.
 N/A re N/A urllib N/A datetime N/A simplejson N/A psycopg2 N/A psycopg2.extras flask request make_response parse_rfc1738_args N/A N/A name N/A N/A N/A Parse the given database URI and return a dictionary of database
    connection values.

    Eg: parse_rfc1738_args('postgres://user:pass@host:5432/dbname')
        -> { 
            'username': 'user', 
            'password': 'pass', 
            'host': 'host',
            'port': '5432',
            'database': 'dbname'
           }
     N/A N/A name None N/A N/A N/A RuntimeError MORESQL_DATABASE_URI needs to be specified N/A pattern N/A N/A re compile 
        (?P<name>[\w\+]+)://
        (?:
        (?P<username>[^:/]*)
        (?::(?P<password>[^/]*))?
        @)?
        (?:
        (?P<host>[^/:]*)
        (?::(?P<port>[^/]*))?
        )?
        (?:/(?P<database>.*))?
         N/A re X N/A match N/A N/A pattern match name N/A N/A match None N/A N/A N/A RuntimeError N/A Wrong DB URI string '%s' name N/A components N/A N/A match groupdict N/A N/A N/A components N/A name postgres N/A N/A N/A RuntimeError MoreSQL only supports postgres databases N/A N/A N/A components N/A password None N/A N/A N/A components N/A password N/A N/A urllib unquote_plus N/A components N/A password N/A N/A components N/A name N/A components N/A _convert_http_value N/A N/A value N/A N/A N/A Try to parse the given JSON value. Return raw value on failure. N/A N/A N/A N/A N/A simplejson loads value N/A N/A N/A N/A simplejson JSONDecodeError N/A N/A value N/A _get_procedure_arguments N/A N/A fields values N/A N/A N/A Return a list of parameters to be passed to the stored procedure. N/A N/A fields None N/A N/A N/A N/A values N/A N/A N/A N/A N/A values get field N/A field fields N/A N/A N/A _convert_http_value N/A N/A N/A request values get field N/A field fields N/A N/A N/A N/A request values get field None N/A dthandler N/A N/A obj N/A N/A N/A N/A isinstance obj N/A datetime datetime N/A N/A N/A N/A obj isoformat N/A MoreSQL N/A object N/A N/A Used to connect to a given PostgreSQL database.

    To use MoreSQL you need to first create a Flask application, and then bind
    a MoreSQL instance to it::

        app = Flask(__name__)
        db = MoreSQL(app)
     __init__ N/A N/A self app N/A N/A N/A N/A self app app N/A creds N/A parse_rfc1738_args N/A N/A N/A app config get MORESQL_DATABASE_URI N/A N/A self connection N/A N/A psycopg2 connect user N/A creds N/A username password N/A creds N/A password dbname N/A creds N/A database host N/A creds N/A host port N/A creds N/A port N/A N/A self cursor N/A N/A N/A self connection cursor cursor_factory N/A N/A psycopg2 extras RealDictCursor N/A execute N/A N/A self procname fields values N/A None None N/A N/A Execute the given stored procedure. Return results as a JSON
        HTTP response.
        
        :param procname: the stored procedure name
        :param fields: a list of dictionary fields used as parameters of the
                       stored procedure. The procedure will be called with no
                       arguments if omitted
        :param values: an optional dictionary of values from which the
                       parameters should be taken. If omitted, default to the 
                       values passed via HTTP
         N/A procargs N/A _get_procedure_arguments fields values N/A result N/A N/A N/A self cursor callproc procname procargs N/A N/A N/A N/A self connection commit N/A N/A procargs result N/A N/A result N/A N/A N/A self cursor fetchall N/A N/A N/A len result 1 N/A N/A N/A N/A len N/A result N/A 0 1 N/A N/A result N/A N/A N/A N/A result N/A 0 values N/A 0 N/A N/A result N/A result N/A 0 N/A N/A make_response N/A N/A simplejson dumps result default dthandler N/A N/A