def get_usage_bound(request): """Simple view to relay the computed usage bound to the front end.""" disk_sizes = [ int(size) for size in request.query_params.getlist("disk_sizes[]") ] raid_level = request.query_params.get("raid_level", "single") return Response(usage_bound(disk_sizes, len(disk_sizes), raid_level))
def usage_bound(self): disk_sizes = [int(size) for size in self.disk_set .values_list('size', flat=True) .order_by('-size')] return usage_bound(disk_sizes, len(disk_sizes), self.raid)
def get_usage_bound(request): """Simple view to relay the computed usage bound to the front end.""" disk_sizes = [int(size) for size in request.query_params.getlist('disk_sizes[]')] raid_level = request.query_params.get('raid_level', 'single') return Response(usage_bound(disk_sizes, len(disk_sizes), raid_level))