I'm using javascript (plus AngularJS and Restangular) to call a Django endpoint and retrieve an array of proposals. But I can't seem to get my Django syntax right.
How do I return and array of objects in a given Django model?
def proposal_api(request):
response = {}
response['proposal_list'] = Proposal.objects.all()
return response
The Django View above throws the following Attribute error: 'dict' object has no attribute 'status_code'
Once I receive the array of proposals from the above Django View (with IDs, names, questions, etc...) I'll use AngularJS to display everything.