Skip to content
Snippets Groups Projects
Commit a3cd984f authored by Jean-Baptiste's avatar Jean-Baptiste
Browse files

update: accept nested fields without ldp:container

parent 412767f0
No related branches found
Tags v3.0.0 v3.0.0-beta.1
No related merge requests found
...@@ -11,7 +11,10 @@ from rest_framework.utils.serializer_helpers import ReturnDict ...@@ -11,7 +11,10 @@ from rest_framework.utils.serializer_helpers import ReturnDict
class LDListMixin: class LDListMixin:
def to_internal_value(self, data): def to_internal_value(self, data):
# data = json.loads(data) # data = json.loads(data)
data = data['ldp:contains'] try:
data = data['ldp:contains']
except TypeError:
pass
if isinstance(data, dict): if isinstance(data, dict):
data = [data] data = [data]
return [self.child.to_internal_value(item) for item in data] return [self.child.to_internal_value(item) for item in data]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment