def run_update(self, language, data): serializer = SubtitleLanguageSerializer( instance=language, data=data, context=self.serializer_context) serializer.is_valid(raise_exception=True) serializer.save()
def run_create(self, data): serializer = SubtitleLanguageSerializer( data=data, context=self.serializer_context) serializer.is_valid(raise_exception=True) return serializer.save()