Error while submiting a form with nested fields
Error append with the djangoldp_invoicing module. Here is what I send to the server:
{
"@context":"http://owl.openinitiative.com/oicontext.jsonld",
"@graph":[
{
"@id":"./",
"http://happy-dev.fr/owl/#batches":{"@id":"_:b381"},
"http://happy-dev.fr/owl/#identifier":3,
"http://happy-dev.fr/owl/#title":"Nouvelle facture",
"http://happy-dev.fr/owl/#tvaRate":20
},
{
"@id":"_:b381",
"http://happy-dev.fr/owl/#tasks":{"@id":"_:b382"},
"http://happy-dev.fr/owl/#title":"Batch 1"
},
{
"@id":"_:b382",
"http://happy-dev.fr/owl/#htAmount":1000,
"http://happy-dev.fr/owl/#title":"Tache 1"
}
]
}
Here is the response
AttributeError at /customer-invoices/
'ManyJsonLdRelatedField' object has no attribute 'child'
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/rest_framework/viewsets.py" in view
116. return self.dispatch(request, *args, **kwargs)
File "/app/djangoldp/views.py" in dispatch
135. response = super(LDPViewSet, self).dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
495. response = self.handle_exception(exc)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py" in handle_exception
455. self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
492. response = handler(request, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/rest_framework/mixins.py" in create
20. serializer.is_valid(raise_exception=True)
File "/usr/local/lib/python3.6/site-packages/rest_framework/serializers.py" in is_valid
236. self._validated_data = self.run_validation(self.initial_data)
File "/usr/local/lib/python3.6/site-packages/rest_framework/serializers.py" in run_validation
434. value = self.to_internal_value(data)
File "/usr/local/lib/python3.6/site-packages/rest_framework/serializers.py" in to_internal_value
491. validated_value = field.run_validation(primitive_value)
File "/usr/local/lib/python3.6/site-packages/rest_framework/serializers.py" in run_validation
626. value = self.to_internal_value(data)
File "/app/djangoldp/serializers.py" in to_internal_value
107. return super().to_internal_value(data)
File "/app/djangoldp/serializers.py" in to_internal_value
34. return [self.child.to_internal_value(item) for item in data]
File "/app/djangoldp/serializers.py" in <listcomp>
34. return [self.child.to_internal_value(item) for item in data]
File "/app/djangoldp/serializers.py" in to_internal_value
263. validated_value = field.run_validation(primitive_value)
File "/usr/local/lib/python3.6/site-packages/rest_framework/fields.py" in run_validation
536. value = self.to_internal_value(data)
File "/app/djangoldp/serializers.py" in to_internal_value
34. return [self.child.to_internal_value(item) for item in data]
File "/app/djangoldp/serializers.py" in <listcomp>
34. return [self.child.to_internal_value(item) for item in data]