|
@ -317,15 +317,12 @@ class ArchivView(generic.ListView): |
|
|
# op == os.path, udělá z argumentů cestu |
|
|
# op == os.path, udělá z argumentů cestu |
|
|
png_dir = op.join(settings.MEDIA_ROOT, "cislo", "png") |
|
|
png_dir = op.join(settings.MEDIA_ROOT, "cislo", "png") |
|
|
|
|
|
|
|
|
# seznam [(url obrázku, číslo)] |
|
|
# slovník {(ročník, url obrázku)} |
|
|
urls ={} |
|
|
urls ={} |
|
|
|
|
|
|
|
|
for i,c in enumerate(cisla): |
|
|
for i,c in enumerate(cisla): |
|
|
if not c.pdf: |
|
|
if not c.pdf: |
|
|
urls[c.rocnik] = op.join(settings.MEDIA_URL, "cislo", "png", "default.png") |
|
|
urls[c.rocnik] = op.join(settings.MEDIA_URL, "cislo", "png", "default.png") |
|
|
# urls.append( |
|
|
|
|
|
# (op.join(settings.MEDIA_URL, "cislo", "png", "default.png"), c.rocnik) |
|
|
|
|
|
# ) |
|
|
|
|
|
else: |
|
|
else: |
|
|
filename = os.path.split(c.pdf.file.name)[1].split(".")[0] |
|
|
filename = os.path.split(c.pdf.file.name)[1].split(".")[0] |
|
|
png_filename = "{}.png".format(filename) |
|
|
png_filename = "{}.png".format(filename) |
|
@ -346,9 +343,6 @@ class ArchivView(generic.ListView): |
|
|
]) |
|
|
]) |
|
|
|
|
|
|
|
|
urls[c.rocnik] = op.join(settings.MEDIA_URL, "cislo", "png", png_filename) |
|
|
urls[c.rocnik] = op.join(settings.MEDIA_URL, "cislo", "png", png_filename) |
|
|
#urls.append( |
|
|
|
|
|
#(op.join(settings.MEDIA_URL, "cislo", "png", png_filename), c.rocnik) |
|
|
|
|
|
#) |
|
|
|
|
|
|
|
|
|
|
|
context["object_list"] = urls |
|
|
context["object_list"] = urls |
|
|
|
|
|
|
|
@ -415,9 +409,7 @@ class ArchivView(generic.ListView): |
|
|
# spirala(urls, tags, 0) |
|
|
# spirala(urls, tags, 0) |
|
|
|
|
|
|
|
|
# context["nahledy"] = "\n".join(tags) |
|
|
# context["nahledy"] = "\n".join(tags) |
|
|
print(context) |
|
|
|
|
|
for i in context["object_list"]: |
|
|
|
|
|
print(context["object_list"][i]) |
|
|
|
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
### Výsledky |
|
|
### Výsledky |
|
|