working on speaker pictures for issue #84

This commit is contained in:
Thomas Steen Rasmussen 2017-02-18 12:30:26 +01:00
parent e8dea3eccc
commit c6b27de400
2 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-18 10:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('program', '0021_auto_20170205_2130'),
]
operations = [
migrations.RenameField(
model_name='speaker',
old_name='picture',
new_name='picture_large',
),
migrations.AddField(
model_name='speaker',
name='picture_small',
field=models.ImageField(blank=True, null=True, upload_to=''),
),
]

View file

@ -106,7 +106,8 @@ class Speaker(CreatedUpdatedModel):
""" A Person anchoring an event. """ """ A Person anchoring an event. """
name = models.CharField(max_length=150) name = models.CharField(max_length=150)
biography = models.TextField() biography = models.TextField()
picture = models.ImageField(null=True, blank=True) picture_small = models.ImageField(null=True, blank=True)
picture_large = models.ImageField(null=True, blank=True)
slug = models.SlugField(blank=True, max_length=255) slug = models.SlugField(blank=True, max_length=255)
camp = models.ForeignKey('camps.Camp', null=True, related_name="speakers") camp = models.ForeignKey('camps.Camp', null=True, related_name="speakers")
events = models.ManyToManyField( events = models.ManyToManyField(
@ -118,7 +119,7 @@ class Speaker(CreatedUpdatedModel):
ordering = ['name'] ordering = ['name']
unique_together = (('camp', 'name'), ('camp', 'slug')) unique_together = (('camp', 'name'), ('camp', 'slug'))
def __str___(self): def __str__(self):
return '%s (%s)' % (self.name, self.camp) return '%s (%s)' % (self.name, self.camp)
def save(self, **kwargs): def save(self, **kwargs):