libs/flask_lib.py
def load_views(log) -> List[ModelView]:
    """[Load view from tables definitions module]

    Args:
        module (ModuleType): [description]

    Returns:
        List[ModelView]: [description]
    """
    log.info("START Loading views models")
    views = []

    for schema, cf in TABLES.items():
        db, tables = cf["db"], cf["tables"]

        for table_name, class_object in tables.items():
            if class_object is None:
                # log.error('Cannot get class for table <%s>'%table_name)
                continue

            attributes = [
                x
                for x, y in class_object.__dict__.items()
                if isinstance(y, InstrumentedAttribute)
            ]

            name = "%s:%s" % (schema, class_object.__tablename__)
            view = AlphaModelView(
                class_object,
                db.session,
                name=class_object.__tablename__,
                category=schema,
                endpoint=name,
            )

            view.column_list = attributes
            views.append(view)
    log.info("END Loading views models")
    return views
[Load view from tables definitions module]

    Args:
        module (ModuleType): [description]

    Returns:
        List[ModelView]: [description]
    
[Load view from tables definitions module]
[ Load view from tables definitions module ]
def load_views(log) -> List[ModelView]:
    log.info("START Loading views models")
    views = []
    for schema, cf in TABLES.items():
        db, tables = cf["db"], cf["tables"]
        for table_name, class_object in tables.items():
            if class_object is None:
                continue
            attributes = [
                x
                for x, y in class_object.__dict__.items()
                if isinstance(y, InstrumentedAttribute)
            ]
            name = "%s:%s" % (schema, class_object.__tablename__)
            view = AlphaModelView(
                class_object,
                db.session,
                name=class_object.__tablename__,
                category=schema,
                endpoint=name,
            )
            view.column_list = attributes
            views.append(view)
    log.info("END Loading views models")
    return views
def load_views ( log ) -> List [ ModelView ] : log . info ( "START Loading views models" ) views = [ ] for schema , cf in TABLES . items ( ) : db , tables = cf [ "db" ] , cf [ "tables" ] for table_name , class_object in tables . items ( ) : if class_object is None : continue attributes = [ x for x , y in class_object . __dict__ . items ( ) if isinstance ( y , InstrumentedAttribute ) ] name = "%s:%s" % ( schema , class_object . __tablename__ ) view = AlphaModelView ( class_object , db . session , name = class_object . __tablename__ , category = schema , endpoint = name , ) view . column_list = attributes views . append ( view ) log . info ( "END Loading views models" ) return views
[Load view from tables definitions module]
[ Load view from tables definitions module ]
"""[Load view from tables definitions module]

    Args:
        module (ModuleType): [description]

    Returns:
        List[ModelView]: [description]
    """ # log.error('Cannot get class for table <%s>'%table_name)
None
List[ModelView]
log
module
None