Browse Source

Galerie models.py: nevyžaduj u fotky galerii

remotes/origin/imagekit
Matěj Kocián 9 years ago
parent
commit
09c015c0dd
  1. 20
      galerie/migrations/0004_nepovinna_galerie_u_obrazku.py
  2. 2
      galerie/models.py

20
galerie/migrations/0004_nepovinna_galerie_u_obrazku.py

@ -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,
),
]

2
galerie/models.py

@ -77,7 +77,7 @@ class Obrazek(models.Model):
popis = models.TextField('Popis', blank = True, null = True)
datum_vlozeni = models.DateTimeField('Datum vložení', auto_now_add = 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)
def __unicode__(self):
return self.nazev + " -- " + unicode(self.obrazek_velky.name) + " (" + str(self.datum) + ")"

Loading…
Cancel
Save