From: Guillaume Pellerin Date: Mon, 29 Feb 2016 15:30:31 +0000 (+0100) Subject: add featured photos and metadata X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=377724e0adba35741279b7455639dd6c5d6218f1;p=mezzo.git add featured photos and metadata --- diff --git a/app/festival/migrations/0004_auto_20160229_1630.py b/app/festival/migrations/0004_auto_20160229_1630.py new file mode 100644 index 00000000..f34db566 --- /dev/null +++ b/app/festival/migrations/0004_auto_20160229_1630.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import mezzanine.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('festival', '0003_auto_20160229_1430'), + ] + + operations = [ + migrations.AddField( + model_name='artist', + name='photo_alignment', + field=models.CharField(default=b'left', max_length=32, verbose_name='photo alignment', choices=[(b'left', 'left'), (b'right', 'right')]), + ), + migrations.AddField( + model_name='artist', + name='photo_featured', + field=mezzanine.core.fields.FileField(max_length=1024, verbose_name='photo featured', blank=True), + ), + migrations.AddField( + model_name='artist', + name='photo_featured_credits', + field=models.CharField(max_length=255, null=True, verbose_name='photo featured credits', blank=True), + ), + ] diff --git a/app/festival/models.py b/app/festival/models.py index c8f3a798..403f8d05 100644 --- a/app/festival/models.py +++ b/app/festival/models.py @@ -14,6 +14,7 @@ from .related import SpanningForeignKey app_label = 'festival' +ALIGNMENT_CHOICES = (('left', _('left')), ('right', _('right'))) class MetaCore: @@ -72,8 +73,11 @@ class Artist(Displayable, RichText, AdminThumbMixin): bio = RichTextField(_('biography'), blank=True) photo = FileField(_('photo'), upload_to='images/photos', max_length=1024, blank=True, format="Image") photo_credits = models.CharField(_('photo credits'), max_length=255, blank=True, null=True) + photo_alignment = models.CharField(_('photo alignment'), choices=ALIGNMENT_CHOICES, max_length=32, default="left") photo_description = models.TextField(_('photo description'), blank=True) featured = models.BooleanField(_('featured'), default=False) + photo_featured = FileField(_('photo featured'), upload_to='images/photos', max_length=1024, blank=True, format="Image") + photo_featured_credits = models.CharField(_('photo featured credits'), max_length=255, blank=True, null=True) search_fields = ("title", "bio")