diff --git a/counter/migrations/0016_producttype_comment.py b/counter/migrations/0016_producttype_comment.py new file mode 100644 index 00000000..26244fe6 --- /dev/null +++ b/counter/migrations/0016_producttype_comment.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('counter', '0015_merge'), + ] + + operations = [ + migrations.AddField( + model_name='producttype', + name='comment', + field=models.TextField(verbose_name='comment', blank=True, null=True), + ), + ] diff --git a/counter/models.py b/counter/models.py index 5183767f..7ca89c6b 100644 --- a/counter/models.py +++ b/counter/models.py @@ -112,6 +112,7 @@ class ProductType(models.Model): """ name = models.CharField(_('name'), max_length=30) description = models.TextField(_('description'), null=True, blank=True) + comment = models.TextField(_('comment'), null=True, blank=True) icon = models.ImageField(upload_to='products', null=True, blank=True) class Meta: diff --git a/counter/views.py b/counter/views.py index bc008d54..6a39619e 100644 --- a/counter/views.py +++ b/counter/views.py @@ -688,7 +688,7 @@ class ProductTypeCreateView(CounterAdminTabsMixin, CounterAdminMixin, CreateView A create view for the admins """ model = ProductType - fields = ['name', 'description', 'icon'] + fields = ['name', 'description', 'comment', 'icon'] template_name = 'core/create.jinja' current_tab = "products" @@ -699,7 +699,7 @@ class ProductTypeEditView(CounterAdminTabsMixin, CounterAdminMixin, UpdateView): """ model = ProductType template_name = 'core/edit.jinja' - fields = ['name', 'description', 'icon'] + fields = ['name', 'description', 'comment', 'icon'] pk_url_kwarg = "type_id" current_tab = "products" diff --git a/eboutic/templates/eboutic/eboutic_main.jinja b/eboutic/templates/eboutic/eboutic_main.jinja index 825435ce..042c7b4e 100644 --- a/eboutic/templates/eboutic/eboutic_main.jinja +++ b/eboutic/templates/eboutic/eboutic_main.jinja @@ -41,6 +41,10 @@ {% for t in categories %} {% if eboutic.products.filter(product_type=t).exists() %}
{{ t.comment }}
+ {% endif %} +