From 930333357e59db23b39a1a95832959060a0674f1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 2 Oct 2018 09:27:20 +0200 Subject: [PATCH] GenericProduct: Remove image field and add slug field --- ...o_20180926_0723.py => 0048_auto_20181002_0725.py} | 5 ++--- hosting/models.py | 12 +++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) rename hosting/migrations/{0048_auto_20180926_0723.py => 0048_auto_20181002_0725.py} (86%) diff --git a/hosting/migrations/0048_auto_20180926_0723.py b/hosting/migrations/0048_auto_20181002_0725.py similarity index 86% rename from hosting/migrations/0048_auto_20180926_0723.py rename to hosting/migrations/0048_auto_20181002_0725.py index 6c21ab03..645067a7 100644 --- a/hosting/migrations/0048_auto_20180926_0723.py +++ b/hosting/migrations/0048_auto_20181002_0725.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2018-09-26 07:23 +# Generated by Django 1.9.4 on 2018-10-02 07:25 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion -import filer.fields.image import utils.mixins @@ -26,7 +25,7 @@ class Migration(migrations.Migration): ('product_price', models.DecimalField(decimal_places=2, max_digits=6)), ('product_vat', models.DecimalField(decimal_places=4, default=0, max_digits=6)), ('product_is_subscription', models.BooleanField(default=True)), - ('product_image', filer.fields.image.FilerImageField(blank=True, help_text='The product image', null=True, on_delete=django.db.models.deletion.CASCADE, to='filer.Image')), + ('product_slug', models.SlugField(blank=True, help_text='An optional html id for the Section. Required to set as target of a link on page', null=True)), ], bases=(utils.mixins.AssignPermissionsMixin, models.Model), ), diff --git a/hosting/models.py b/hosting/models.py index ba503753..ca41452d 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -8,7 +8,6 @@ from django.utils import timezone from django.utils.functional import cached_property from datacenterlight.models import VMPricing, VMTemplate -from filer.fields.image import FilerImageField from membership.models import StripeCustomer, CustomUser from utils.mixins import AssignPermissionsMixin from utils.models import BillingAddress @@ -67,14 +66,17 @@ class GenericProduct(AssignPermissionsMixin, models.Model): product_name = models.CharField(max_length=128, default="") product_description = models.CharField(max_length=500, default="") created_at = models.DateTimeField(auto_now_add=True) - product_image = FilerImageField( - on_delete=models.CASCADE, null=True, blank=True, - help_text='The product image' - ) product_url = models.URLField(max_length=1000, null=True, blank=True) product_price = models.DecimalField(max_digits=6, decimal_places=2) product_vat = models.DecimalField(max_digits=6, decimal_places=4, default=0) product_is_subscription = models.BooleanField(default=True) + product_slug = models.SlugField( + blank=True, null=True, + help_text=( + 'An optional html id for the Section. Required to set as target ' + 'of a link on page' + ) + ) def __str__(self): return self.product_name