get_parent_views = async (table, viewname) => {
  let parent_views = [];
  const parentrels = table
    .getFields()
    .filter((f) => f.is_fkey && f.type !== "File");
  for (const relation of parentrels) {
    const related_table = Table.findOne({
      name: relation.reftable_name,
    });
    const views = await View.find_table_views_where(
      related_table,
      ({ state_fields, viewrow }) =>
        viewrow.name !== viewname && state_fields.some((sf) => sf.name === "id")
    );

    parent_views.push({ relation, related_table, views });
  }
  return parent_views;
}
Get parent views
@function
@param {Table|object} table
@param {string} viewname
@returns {Promise<object[]>}