Galerie: řaď obrázky defaultně dle data pořízení

Aby fungovaly přechody mezi galeriemi v detailu.
This commit is contained in:
Matěj Kocián 2015-11-20 11:15:10 +01:00
parent 666bffee08
commit 577ac83d04
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('galerie', '0004_nepovinna_galerie_u_obrazku'),
]
operations = [
migrations.AlterModelOptions(
name='obrazek',
options={'ordering': ['datum'], 'verbose_name': 'Obr\xe1zek', 'verbose_name_plural': 'Obr\xe1zky'},
),
]

View file

@ -84,6 +84,7 @@ class Obrazek(models.Model):
class Meta:
verbose_name = 'Obrázek'
verbose_name_plural = 'Obrázky'
ordering = ['datum']
def save(self):
original = Image.open(self.obrazek_velky)
# vycteni EXIFu