def get_views(self, schema, echo=True):
    'Get metadata for views.'
    schemas = (schema if isinstance(schema, list) else [schema])

    def get_views_for(schema):

        def get_rec(view):
            self._fields = ['schema', 'view']
            return tuple([schema, view])
            Rec = namedtuple('View', 'schema view')
            self._fields = Rec._fields
            r_dict = dict(schema=schema, view=view)
            return Rec(**r_dict)
        sql_tmpl = self._template('metadata.views')
        if sql_tmpl:
            views = [r[0] for r in self.query(sql_tmpl.format(schema=schema))]
        else:
            self.get_engine(echo=echo)
            views = self.engine_inspect.get_view_names(schema)
        return [get_rec(v) for v in sorted(views)]
    rows = []
    for schema in schemas:
        for row in get_views_for(schema):
            rows.append(row)
    return rows
Get metadata for views.
def get_views(self, schema, echo=True):
    
    schemas = (schema if isinstance(schema, list) else [schema])

    def get_views_for(schema):

        def get_rec(view):
            self._fields = ['schema', 'view']
            return tuple([schema, view])
            Rec = namedtuple('View', 'schema view')
            self._fields = Rec._fields
            r_dict = dict(schema=schema, view=view)
            return Rec(**r_dict)
        sql_tmpl = self._template('metadata.views')
        if sql_tmpl:
            views = [r[0] for r in self.query(sql_tmpl.format(schema=schema))]
        else:
            self.get_engine(echo=echo)
            views = self.engine_inspect.get_view_names(schema)
        return [get_rec(v) for v in sorted(views)]
    rows = []
    for schema in schemas:
        for row in get_views_for(schema):
            rows.append(row)
    return rows