From f3bf6d53007c1108ffdc0184cac75bc9c7c9a1bc Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Tue, 13 Oct 2015 19:00:37 +0200 Subject: [PATCH] galerie | zmena cest na ukladani souboru rozumneji --- galerie/TODO | 1 + galerie/models.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/galerie/TODO b/galerie/TODO index ccfd1200..c8afd3c4 100644 --- a/galerie/TODO +++ b/galerie/TODO @@ -3,6 +3,7 @@ |======| Aktualni +* co s titulni fotkou * do CSS * nahledy * nastylovat tabulku s nahledy diff --git a/galerie/models.py b/galerie/models.py index e3f15f06..62ce26a2 100644 --- a/galerie/models.py +++ b/galerie/models.py @@ -62,11 +62,11 @@ def obrazek_filename_maly(self, filename): def obrazek_filename_obecny(self, filename, typ): gal = self.galerie + cislo_gal = force_unicode(gal.pk) cesta = "" while(not gal.soustredeni): - cesta = os.path.join(force_unicode(gal.nazev), cesta) gal = gal.galerie_up - return os.path.join('Galerie', force_unicode(gal.soustredeni), cesta, typ, force_unicode(self.nazev)) + return os.path.join('Galerie', "soustredeni_" + force_unicode(gal.soustredeni.pk), "galerie_" + cislo_gal, typ, force_unicode(self.nazev)) class Obrazek(models.Model): obrazek_velky = models.ImageField(upload_to=obrazek_filename,