Exemple #1
0
 def getAllDocuments(self, request):
     documents = Document.getAllDocuments()
     serialized_obj = serializers.serialize('json', documents)
     if serialized_obj:
         serialized_obj = json.loads(serialized_obj)
     result = {'status': 'success', 'data': serialized_obj}
     return result
Exemple #2
0
 def get(self, request, *args, **kwargs):
     documents = Document.getAllDocuments()
     user = request.user
     divisions = Division.objects.all()
     return render(request, self.template_name, {'documents': documents , 'user': user, 'divisions': divisions})