Added viewing user profiles

This commit is contained in:
tomtom5152
2015-03-25 18:56:29 +00:00
parent 3230b03606
commit e5fa55ea6c
3 changed files with 57 additions and 1 deletions

View File

@@ -249,4 +249,16 @@ class SecureAPIRequest(generic.View):
json = simplejson.dumps(results[:20])
return HttpResponse(json, content_type="application/json") # Always json
return HttpResponse(model)
return HttpResponse(model)
class ProfileDetail(generic.DetailView):
model = models.Profile
def get_queryset(self):
try:
pk = self.kwargs['pk']
except KeyError:
pk = self.request.user.id
self.kwargs['pk'] = pk
return self.model.objects.filter(pk=pk)