def __eq__()

in source/idea/idea-data-model/src/ideadatamodel/virtual_desktop/virtual_desktop_model.py [0:0]


    def __eq__(self, other):
        eq = True
        eq = eq and self.base_os == other.base_os
        eq = eq and self.name == other.name
        eq = eq and self.description == other.description
        eq = eq and self.ami_id == other.ami_id
        eq = eq and self.min_storage == other.min_storage
        eq = eq and self.min_ram == other.min_ram
        eq = eq and self.gpu == other.gpu
        eq = eq and self.placement == other.placement

        self_project_ids = [project.project_id for project in self.projects] if self.projects else []
        other_project_ids = [project.project_id for project in other.projects] if other.projects else []
        eq = eq and len(self_project_ids) == len(other_project_ids)
        eq = eq and all(project_id in self_project_ids for project_id in other_project_ids)
        
        self_allowed_instance_types = self.allowed_instance_types if self.allowed_instance_types else []
        other_allowed_instance_types = other.allowed_instance_types if other.allowed_instance_types else []
        eq = eq and len(self_allowed_instance_types) == len(other_allowed_instance_types)
        eq = eq and all(instance_type in self_allowed_instance_types for instance_type in other_allowed_instance_types)

        return eq