Exemplo n.º 1
0
def home(request):
    collections = Collection.objects.all().order_by("name")
    raw_extent = Collection.objects.all().aggregate(Sum("extent"))["extent__sum"]
    extent = bytes2human(raw_extent)

    return render_to_response(
        "dl_collections/index.html", {"collections": collections, "extent": extent, "campuses": campuses}
    )
Exemplo n.º 2
0
def UC(request, urlstuff):
    campus = get_object_or_404(Campus, slug=urlstuff)
    extent = bytes2human(
        Collection.objects.filter(campus__slug__exact=urlstuff).aggregate(Sum("extent"))["extent__sum"] or 0
    )
    collections = Collection.objects.filter(campus__slug__exact=urlstuff).order_by("name")
    return render_to_response(
        "dl_collections/campus.html",
        {"campus": campus, "collections": collections, "extent": extent, "campuses": campuses},
    )
 def human_extent(self):
     return bytes2human(self.extent)
Exemplo n.º 4
0
 def human_extent(self):
     return bytes2human(self.extent, format=u'%(value).1f\xa0%(symbol)s')
Exemplo n.º 5
0
 def human_extent(self):
     return bytes2human(self.extent, format=u'%(value).1f\xa0%(symbol)s')
Exemplo n.º 6
0
 def human_extent(self):
     return bytes2human(self.extent)