refactor: update Product model to use to_dict for image serialization
This commit is contained in:
+2
-2
@@ -111,8 +111,8 @@ class Product(models.Model):
|
||||
"price": self.price,
|
||||
"stock": self.stock,
|
||||
"category": self.category.to_dict(),
|
||||
"primary_image": self.primary_image,
|
||||
"secondary_images": [secondary_image.to_dict() for secondary_image in self.secondary_images],
|
||||
"primary_image": self.primary_image.to_dict(),
|
||||
"secondary_images": [secondary_image.to_dict() for secondary_image in self.secondary_images.all()],
|
||||
"creator": self.creator.to_dict()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user