示例#1
0
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))
示例#2
0
 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)
示例#3
0
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))
示例#4
0
 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)