Document model appears to fetch mostly properly
Can fetch Documents, and then get pages triggers page retrieval and related field retrieval.
This commit is contained in:
parent
806f22db17
commit
9d2d000e48
5 changed files with 159 additions and 9 deletions
|
@ -66,7 +66,9 @@ def document(request):
|
|||
|
||||
def document_detail(request, id):
|
||||
document = models.Document.objects.get(pk=id)
|
||||
pages = models.Page.objects.filter(document__pk=document.id).values('id','page_num')
|
||||
context = extract_fields(document)
|
||||
context['page_ids'] = [p['id'] for p in pages]
|
||||
return json_response(context)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue