Get fields correctly
This commit is contained in:
parent
77fa49ac2b
commit
60cbf42997
1 changed files with 6 additions and 6 deletions
12
app/views.py
12
app/views.py
|
@ -239,12 +239,12 @@ class PeopleDetailView(View):
|
|||
person = get_object_or_404(Person, id=people_id)
|
||||
return_data = {
|
||||
'data': person.dict(),
|
||||
'resources': [r.dict() for r in person.resourcespeople_set.all()],
|
||||
'ranges': [r.dict() for r in person.rangespeople_set.all()],
|
||||
'fields': [r.name for r in person.fieldspeople_set.all()],
|
||||
'methods': [r.name for r in person.methodspeople_set.all()],
|
||||
'scales': [r.name for r in person.scalespeople_set.all()],
|
||||
'taxa': [r.name for r in person.taxapeople_set.all()],
|
||||
'resources': [r.resource.dict() for r in person.resourcespeople_set.all()],
|
||||
'ranges': [r.range.dict() for r in person.rangespeople_set.all()],
|
||||
'fields': [r.field.name for r in person.fieldspeople_set.all()],
|
||||
'methods': [r.method.name for r in person.methodspeople_set.all()],
|
||||
'scales': [r.scale.name for r in person.scalespeople_set.all()],
|
||||
'taxa': [r.taxon.name for r in person.taxapeople_set.all()],
|
||||
}
|
||||
return JsonResponse(return_data)
|
||||
|
||||
|
|
Loading…
Reference in a new issue