Added image field in collection for homepage view
authordurandn
Fri, 12 Aug 2016 16:36:16 +0200
changeset 122 4fab4a909915
parent 121 1264552829f8
child 123 c8a1216fd28f
Added image field in collection for homepage view
src/iconolab/migrations/0009_auto_20160812_1417.py
src/iconolab/models.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),
+        ),
+    ]
--- 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