# HG changeset patch # User durandn # Date 1471012576 -7200 # Node ID 4fab4a9099151f3104680d4fbc5a6dc1a5f5ac9b # Parent 1264552829f8e244bac82fb97a4b557f7fb38cca Added image field in collection for homepage view diff -r 1264552829f8 -r 4fab4a909915 src/iconolab/migrations/0009_auto_20160812_1417.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/iconolab/migrations/0009_auto_20160812_1417.py Fri Aug 12 16:36:16 2016 +0200 @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-12 14:17 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('iconolab', '0008_auto_20160811_1050'), + ] + + operations = [ + migrations.AddField( + model_name='collection', + name='height', + field=models.IntegerField(blank=True, null=True), + ), + migrations.AddField( + model_name='collection', + name='image', + field=models.ImageField(blank=True, height_field='height', null=True, upload_to='uploads/', width_field='width'), + ), + migrations.AddField( + model_name='collection', + name='width', + field=models.IntegerField(blank=True, null=True), + ), + ] diff -r 1264552829f8 -r 4fab4a909915 src/iconolab/models.py --- a/src/iconolab/models.py Fri Aug 12 15:34:43 2016 +0200 +++ b/src/iconolab/models.py Fri Aug 12 16:36:16 2016 +0200 @@ -31,6 +31,9 @@ name = models.SlugField(max_length=50, unique=True) verbose_name = models.CharField(max_length=50, null=True, blank=True) description = models.CharField(max_length=255) + image = models.ImageField(upload_to='uploads/', height_field='height', width_field='width', null=True, blank=True) + height = models.IntegerField(null=True, blank=True) + width = models.IntegerField(null=True, blank=True) def __str__(self): return self.name