Galerie models.py: nevyžaduj u fotky galerii
This commit is contained in:
parent
84d7382ffb
commit
09c015c0dd
2 changed files with 21 additions and 1 deletions
20
galerie/migrations/0004_nepovinna_galerie_u_obrazku.py
Normal file
20
galerie/migrations/0004_nepovinna_galerie_u_obrazku.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('galerie', '0003_add_galerie_poradi'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='obrazek',
|
||||||
|
name='galerie',
|
||||||
|
field=models.ForeignKey(blank=True, to='galerie.Galerie', null=True),
|
||||||
|
preserve_default=True,
|
||||||
|
),
|
||||||
|
]
|
|
@ -77,7 +77,7 @@ class Obrazek(models.Model):
|
||||||
popis = models.TextField('Popis', blank = True, null = True)
|
popis = models.TextField('Popis', blank = True, null = True)
|
||||||
datum_vlozeni = models.DateTimeField('Datum vložení', auto_now_add = True)
|
datum_vlozeni = models.DateTimeField('Datum vložení', auto_now_add = True)
|
||||||
datum = models.DateTimeField('Datum pořízení fotografie', blank = True, null = True)
|
datum = models.DateTimeField('Datum pořízení fotografie', blank = True, null = True)
|
||||||
galerie = models.ForeignKey('Galerie')
|
galerie = models.ForeignKey('Galerie', blank=True, null=True)
|
||||||
poradi = models.IntegerField('Pořadí', blank = True, null = True)
|
poradi = models.IntegerField('Pořadí', blank = True, null = True)
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.nazev + " -- " + unicode(self.obrazek_velky.name) + " (" + str(self.datum) + ")"
|
return self.nazev + " -- " + unicode(self.obrazek_velky.name) + " (" + str(self.datum) + ")"
|
||||||
|
|
Loading…
Reference in a new issue