Hi guys, 

i have an issue trying to create multiples products with rest framework 

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 

  serializer = ProductSerializer(data=products, many=True, read_only=False) 


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?


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 django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to