def calibre(id): """ Export a zip of metadata and cover """ m = Maker.objects.get_or_404(id=id) things = Thing.objects.filter(makers__maker=m) archive = archive_things(things) return Response(archive, mimetype="application/x-zip-compressed", headers={"Content-Disposition": "attachment;filename=%s.zip" % id})
def calibre(id): """ Export a zip of metadata and cover """ c = Collection.objects.get_or_404(id=id) things = [ct.thing for ct in c.things] archive = archive_things(things) return Response(archive, mimetype="application/x-zip-compressed", headers={"Content-Disposition": "attachment;filename=%s.zip" % id})
def calibre(id): """ Export a zip of metadata and cover """ m = Maker.objects.get_or_404(id=id) things = Thing.objects.filter(makers__maker=m) archive = archive_things(things) return Response( archive, mimetype="application/x-zip-compressed", headers={"Content-Disposition": "attachment;filename=%s.zip" % id})