You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def _handle_nested_structures(self, product, nested):
attributes = nested['attributes']
shop_products = nested['shop_products']
if not self.partial:
if attributes is not None:
product.attributes.all().delete()
if shop_products is not None:
product.shop_products.all().delete()
if attributes:
for attribute_data in attributes:
self._handle_attribute_value(product, attribute_data)
if shop_products:
for shop_product_data in shop_products:
self._handle_shop_product(product, shop_product_data)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey guys, can you tell me please, what's the purpose of recreating Attributes and ShopProducts when product is updated?
class ProductSerializer(TranslatableModelSerializer):
Beta Was this translation helpful? Give feedback.
All reactions