Exemplo n.º 1
0
 def perform_update(self, serializer):
     serializer.validated_data['product'] = self.product
     serializer.validated_data['updated_at'] = now()
     serializer.validated_data['src'] = (
         serializer.validated_data.get('src')
         or serializer.validated_data.get('attachment'))
     if 'attachment' in serializer.validated_data:
         del serializer.validated_data['attachment']
     serializer.save()
Exemplo n.º 2
0
 def perform_update(self, serializer):
     serializer.validated_data['product'] = self.product
     serializer.validated_data['updated_at'] = now()
     serializer.validated_data['src'] = (
         serializer.validated_data.get('src') or
         serializer.validated_data.get('attachment')
     )
     if 'attachment' in serializer.validated_data:
         del serializer.validated_data['attachment']
     serializer.save()
Exemplo n.º 3
0
 def perform_create(self, serializer):
     serializer.validated_data['created_at'] = now()
     self.perform_update(serializer)
Exemplo n.º 4
0
 def perform_update(self, serializer):
     serializer.validated_data['updated_at'] = now()
     serializer.save()
Exemplo n.º 5
0
 def perform_create(self, serializer):
     serializer.validated_data['created_at'] = now()
     serializer.validated_data['position'] = self.get_queryset().count() + 1
     self.perform_update(serializer)
Exemplo n.º 6
0
 def perform_create(self, serializer):
     serializer.validated_data['created_at'] = now()
     self.perform_update(serializer)
Exemplo n.º 7
0
 def perform_update(self, serializer):
     serializer.validated_data['updated_at'] = now()
     serializer.save()
Exemplo n.º 8
0
 def perform_create(self, serializer):
     serializer.validated_data['created_at'] = now()
     serializer.validated_data['position'] = self.get_queryset().count() + 1
     self.perform_update(serializer)