Exemplo n.º 1
0
 def shared_pagination_GET_params(self):
     start_date = self.datespan.startdate.strftime('%Y-%m-%d')
     end_date = self.datespan.enddate.strftime('%Y-%m-%d')
     return [
         {'name': 'startdate', 'value': start_date},
         {'name': 'enddate', 'value': end_date},
         {'name': 'log_type', 'value': MessageTypeFilter.get_value(self.request, self.domain)},
         {'name': 'location_id', 'value': AsyncLocationFilter.get_value(self.request, self.domain)},
     ]
Exemplo n.º 2
0
 def shared_pagination_GET_params(self):
     start_date = self.datespan.startdate.strftime("%Y-%m-%d")
     end_date = self.datespan.enddate.strftime("%Y-%m-%d")
     return [
         {"name": "startdate", "value": start_date},
         {"name": "enddate", "value": end_date},
         {"name": "log_type", "value": MessageTypeFilter.get_value(self.request, self.domain)},
         {"name": "location_id", "value": AsyncLocationFilter.get_value(self.request, self.domain)},
     ]
    def get_location_filter(self):
        locations = []
        location_id = AsyncLocationFilter.get_value(self.request, self.domain)
        if location_id:
            locations = SQLLocation.objects.get(
                location_id=location_id).get_descendants(
                    include_self=True).filter(
                        location_type__administrative=False).values_list(
                            'location_id', flat=True)

        return locations
Exemplo n.º 4
0
    def get_location_filter(self):
        locations = []
        location_id = AsyncLocationFilter.get_value(self.request, self.domain)
        if location_id:
            locations = (
                SQLLocation.objects.get(location_id=location_id)
                .get_descendants(include_self=True)
                .filter(location_type__administrative=False)
                .values_list("location_id", flat=True)
            )

        return locations