mirror of
				https://github.com/kevinveenbirkenbach/baserow-ifto.git
				synced 2025-11-04 11:47:59 +00:00 
			
		
		
		
	Implemented multi table matrix
This commit is contained in:
		@@ -100,13 +100,15 @@ class BaserowAPI:
 | 
			
		||||
            tables_data[table_id] = table_data
 | 
			
		||||
        return tables_data
 | 
			
		||||
    
 | 
			
		||||
    def build_matrix(self, tables_data, reference_map={}):
 | 
			
		||||
    def build_multitable_matrix(self, tables_data):
 | 
			
		||||
        for table_name, table_rows in tables_data.copy().items():
 | 
			
		||||
            self.build_matrix(tables_data,table_name, table_rows)
 | 
			
		||||
            
 | 
			
		||||
    def build_matrix(self, tables_data, table_name, table_rows, reference_map={}):
 | 
			
		||||
        """Build a matrix with linked rows filled recursively."""
 | 
			
		||||
        reference_map_child = reference_map.copy()
 | 
			
		||||
 | 
			
		||||
        for table_name, table_rows in tables_data.copy().items():
 | 
			
		||||
            self.process_link_fields(table_name, tables_data, reference_map_child)
 | 
			
		||||
            self.fill_cells_with_related_content(table_name, table_rows, reference_map_child)
 | 
			
		||||
        self.process_link_fields(table_name, tables_data, reference_map_child)
 | 
			
		||||
        self.fill_cells_with_related_content(table_name, table_rows, reference_map_child)
 | 
			
		||||
 | 
			
		||||
        return tables_data
 | 
			
		||||
 | 
			
		||||
@@ -135,7 +137,7 @@ class BaserowAPI:
 | 
			
		||||
                            self.print_verbose_message(f"Skipped {related_cell_identifier}. Already implemented")
 | 
			
		||||
                            break
 | 
			
		||||
                        
 | 
			
		||||
                        reference_map_child[table_column_name]["embeded"].add(related_cell_identifier)
 | 
			
		||||
                        reference_map_child[table_column_name]["embeded"].append(related_cell_identifier)
 | 
			
		||||
                        
 | 
			
		||||
    
 | 
			
		||||
    def generate_related_cell_identifier(self, table_id, table_column_id, table_row_id):
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ def main():
 | 
			
		||||
            handle_output(args.quiet, tables_data)
 | 
			
		||||
        
 | 
			
		||||
        if "matrix" in args.output:
 | 
			
		||||
            matrix_data = api.build_matrix(tables_data)
 | 
			
		||||
            matrix_data = api.build_multitable_matrix(tables_data)
 | 
			
		||||
            handle_output(args.quiet, matrix_data)
 | 
			
		||||
    
 | 
			
		||||
    if args.database_id:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user