Exemplo n.º 1
0
 def _basic_query(self, user_id, start=None, end=None, timestamps=False):
     q = self.session.query(TicketCurrentStatus)
     q = q.filter_by(handler_id=user_id)
     if start is not None:
         if timestamps:
             start, end = convert_range_to_datetime(start, end)
         q = self._range_filter(q, start, end)
     return q
Exemplo n.º 2
0
 def get_delegated_query(self, user_id, start=None, end=None, timestamps=False):
     q = self.session.query(TicketCurrentStatus)
     q = q.filter_by(changed_by_id=user_id)
     if start is not None:
         if timestamps:
             start, end = convert_range_to_datetime(start, end)
         q = self._range_filter(q, start, end)
     q = q.filter(TicketCurrentStatus.status != "closed")
     q = q.filter(TicketCurrentStatus.handler_id != user_id)
     return q
Exemplo n.º 3
0
 def get_accessible(self, user_id,
                start=None, end=None, timestamps=False):
     q = self.session.query(CaseCurrentStatus)
     q = q.filter(CaseUser.case_id == CaseCurrentStatus.case_id)
     q = q.filter(CaseUser.user_id == user_id)
     if start is not None:
         if timestamps:
             start, end = convert_range_to_datetime(start, end)
         q = self._range_filter(q, start, end)
     q = q.filter(CaseCurrentStatus.status != 'closed')
     return q.all()
Exemplo n.º 4
0
 def get_current_status_range(self, start, end, timestamps=False):
     if timestamps:
         start, end = convert_range_to_datetime(start, end)
     q = self.session.query(CaseCurrentStatus)
     q = self._range_filter(q, start, end)
     return q.all()