We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class SectionSerializer(TranslatableModelSerializer): translations = TranslatedFieldsField(shared_model=Section) section_group = SectionGroupSerializer(many=True) class Meta: model = Section fields = ( 'translations', 'min_age', 'image', 'section_group' ) @transaction.atomic def create(self, validated_data): section_group = validated_data.pop('section_group') section = super().create(validated_data) section_group = [{**i, 'section': section.id} for i in section_group] serializer = SectionGroupSerializer( data=section_group, many=True ) serializer.is_valid(raise_exception=True) serializer.save()
When i ran this code, i got exception: self.model._meta.object_name, obj, TypeError: 'SectionGroupTranslation' instance expected, got 'uz'
self.model._meta.object_name, obj, TypeError: 'SectionGroupTranslation' instance expected, got 'uz'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When i ran this code, i got exception:
self.model._meta.object_name, obj, TypeError: 'SectionGroupTranslation' instance expected, got 'uz'
The text was updated successfully, but these errors were encountered: