Esempio n. 1
0
 def make_query(self, ask=None):
     changes = list(
         self.model.objects.filter(content_type__model__in=[
             "creditpurchasereturn", "inventorypurchasereturn"
         ]).order_by('-timestamp').values())
     prepare_changes_data(changes)
     return changes
Esempio n. 2
0
 def post(self, request, *args, **kwargs):
     if request.POST:
         b = request.POST['b']
         e = request.POST['e']
         p = request.POST['p']
         data = {}
         data['summary'] = self.process_summary(request, b, e, p)
         gdat = self.process_graph(request, b, e, p)
         prepare_changes_data(gdat['inc'])
         data['inc'] = gdat['inc']
         prepare_changes_data(gdat['dec'])
         data['dec'] = gdat['dec']
         data['chart'] = gdat['chart']
         data['status'] = True
     else:
         data = {'status': False}
     return JsonResponse(data)
Esempio n. 3
0
 def make_query(self, ask=None):
     changes = list(
         self.model.objects.filter(**ask).order_by('-timestamp').values())
     prepare_changes_data(changes)
     return changes