예제 #1
0
 def run_update(self, language, data):
     serializer = SubtitleLanguageSerializer(
         instance=language, data=data, context=self.serializer_context)
     serializer.is_valid(raise_exception=True)
     serializer.save()
예제 #2
0
 def run_create(self, data):
     serializer = SubtitleLanguageSerializer(
         data=data, context=self.serializer_context)
     serializer.is_valid(raise_exception=True)
     return serializer.save()