|
@ -35,7 +35,7 @@ def obrazek_filename_obecny(self, filename, typ): |
|
|
gal = self.galerie |
|
|
gal = self.galerie |
|
|
cesta = "" |
|
|
cesta = "" |
|
|
while(not gal.soustredeni): |
|
|
while(not gal.soustredeni): |
|
|
cesta = os.path.join(cesta, force_unicode(gal.nazev)) |
|
|
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', force_unicode(gal.soustredeni), cesta, typ, force_unicode(self.nazev)) |
|
|
|
|
|
|
|
@ -59,7 +59,9 @@ class Obrazek(models.Model): |
|
|
def save(self): |
|
|
def save(self): |
|
|
original = Image.open(self.obrazek_velky) |
|
|
original = Image.open(self.obrazek_velky) |
|
|
jmeno = os.path.basename(self.obrazek_velky.file.name) |
|
|
jmeno = os.path.basename(self.obrazek_velky.file.name) |
|
|
|
|
|
if not self.obrazek_stredni: |
|
|
Obrazek._vyrobMiniaturu(original, jmeno, 500, self.obrazek_stredni) |
|
|
Obrazek._vyrobMiniaturu(original, jmeno, 500, self.obrazek_stredni) |
|
|
|
|
|
if not self.obrazek_maly: |
|
|
Obrazek._vyrobMiniaturu(original, jmeno, 200, self.obrazek_maly) |
|
|
Obrazek._vyrobMiniaturu(original, jmeno, 200, self.obrazek_maly) |
|
|
super(Obrazek, self).save() |
|
|
super(Obrazek, self).save() |
|
|
|
|
|
|
|
|