def delete_row(table_id, instance): """ This creates one query per delete so could potentially be very slow. If you need to delete rows in batches it would be better to add a method to the pyft library following the pattern for insert() batches """ fusion_table = FusionTable(table_id) table_content_type = ContentType.objects.get_for_model(instance) row_id = get_fusion_table_row_id_for_instance(table_content_type, instance) if row_id is not None: query = SQL().delete(table_id, row_id) fusion_table.run_query(query) FusionTableRowId.objects\ .get(content_type = table_content_type, object_id = instance.pk)\ .delete()