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