galerie | zmena cest na ukladani souboru rozumneji
This commit is contained in:
parent
bd01182b2e
commit
f3bf6d5300
2 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
|======|
|
|======|
|
||||||
|
|
||||||
Aktualni
|
Aktualni
|
||||||
|
* co s titulni fotkou
|
||||||
* do CSS
|
* do CSS
|
||||||
* nahledy
|
* nahledy
|
||||||
* nastylovat tabulku s nahledy
|
* nastylovat tabulku s nahledy
|
||||||
|
|
|
@ -62,11 +62,11 @@ def obrazek_filename_maly(self, filename):
|
||||||
|
|
||||||
def obrazek_filename_obecny(self, filename, typ):
|
def obrazek_filename_obecny(self, filename, typ):
|
||||||
gal = self.galerie
|
gal = self.galerie
|
||||||
|
cislo_gal = force_unicode(gal.pk)
|
||||||
cesta = ""
|
cesta = ""
|
||||||
while(not gal.soustredeni):
|
while(not gal.soustredeni):
|
||||||
cesta = os.path.join(force_unicode(gal.nazev), cesta)
|
|
||||||
gal = gal.galerie_up
|
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):
|
class Obrazek(models.Model):
|
||||||
obrazek_velky = models.ImageField(upload_to=obrazek_filename,
|
obrazek_velky = models.ImageField(upload_to=obrazek_filename,
|
||||||
|
|
Loading…
Reference in a new issue