-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
It is not very clear how to server large numbers of related objects as is obvious they cannot be loaded explicitely in relation json-api/json-api#1120
One way I thouht was to just set emtpy data=[] and serve just link to the relation so user can access different relation view as usual collection view.
"relationships": {
...
"comments": {
"links": {
"self": "http://example.com/articles/1/relationships/comments",
"related": "http://example.com/articles/1/comments"
},
"data": [ ]
}
}
The only way to do it is:
myobj = s.get('myobj', '1234').resource
for ch in myobj.children:
for r in s.iterate("myobjs/%s/children" % (ch.id)):
print(". ", r.id, r.some_field)
is there an plan to support relation iterator?
Metadata
Metadata
Assignees
Labels
No labels