Galerie: řaď obrázky defaultně dle data pořízení
Aby fungovaly přechody mezi galeriemi v detailu.
This commit is contained in:
parent
666bffee08
commit
577ac83d04
2 changed files with 19 additions and 0 deletions
18
galerie/migrations/0005_obrazek_ordering_datum.py
Normal file
18
galerie/migrations/0005_obrazek_ordering_datum.py
Normal 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'},
|
||||||
|
),
|
||||||
|
]
|
|
@ -84,6 +84,7 @@ class Obrazek(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = 'Obrázek'
|
verbose_name = 'Obrázek'
|
||||||
verbose_name_plural = 'Obrázky'
|
verbose_name_plural = 'Obrázky'
|
||||||
|
ordering = ['datum']
|
||||||
def save(self):
|
def save(self):
|
||||||
original = Image.open(self.obrazek_velky)
|
original = Image.open(self.obrazek_velky)
|
||||||
# vycteni EXIFu
|
# vycteni EXIFu
|
||||||
|
|
Loading…
Reference in a new issue