Hi guys,
i have an issue trying to create multiples products with rest framework
serializer
first i have a dictionary of products
[{'name': 'test1', 'product_type': product_type}]
i have a Product and ProductType classes, the product_type is an instance
of some product_type. so then i create the serializer and try to validate
them
serializer = ProductSerializer(data=products, many=True, read_only=False)
serializer.is_valid(raise_exception=True)
>
>
when it's running the is_valid method raise an error
Incorrect type. Expected resource identifier object, received ProductType.
i don't know what kind of object i have to send when i try to link a
relationship for those products.
can someone help me with that?
thanks!
Introducir código aquí...
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.