def remove_product(self, product): collect = Collect.find_first(collection_id=self.id, product_id=product.id) if collect: collect.destroy()