diff --git a/club/migrations/0010_club_logo.py b/club/migrations/0010_club_logo.py new file mode 100644 index 00000000..9e8d4288 --- /dev/null +++ b/club/migrations/0010_club_logo.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('club', '0009_auto_20170822_2232'), + ] + + operations = [ + migrations.AddField( + model_name='club', + name='logo', + field=models.ImageField(null=True, upload_to='club_logos', blank=True, verbose_name='logo'), + ), + ] diff --git a/club/models.py b/club/models.py index 59bc91f6..1a63aaca 100644 --- a/club/models.py +++ b/club/models.py @@ -57,6 +57,7 @@ class Club(models.Model): 'unique': _("A club with that unix name already exists."), }, ) + logo = models.ImageField(upload_to='club_logos', verbose_name=_('logo'), null=True, blank=True) address = models.CharField(_('address'), max_length=254) # email = models.EmailField(_('email address'), unique=True) # This should, and will be generated automatically owner_group = models.ForeignKey(Group, related_name="owned_club", diff --git a/club/views.py b/club/views.py index d2a32b01..a8206fe6 100644 --- a/club/views.py +++ b/club/views.py @@ -337,7 +337,7 @@ class ClubEditView(ClubTabsMixin, CanEditMixin, UpdateView): """ model = Club pk_url_kwarg = "club_id" - fields = ['address'] + fields = ['address', 'logo'] template_name = 'core/edit.jinja' current_tab = "edit"