@@ -0,0 +1,21 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+# Generated by Django 1.11.22 on 2019-07-19 11:39 |
|
| 3 |
+from __future__ import unicode_literals |
|
| 4 |
+ |
|
| 5 |
+from django.db import migrations, models |
|
| 6 |
+import django_models_ext.fileext |
|
| 7 |
+ |
|
| 8 |
+ |
|
| 9 |
+class Migration(migrations.Migration): |
|
| 10 |
+ |
|
| 11 |
+ dependencies = [ |
|
| 12 |
+ ('mch', '0036_auto_20190719_1508'),
|
|
| 13 |
+ ] |
|
| 14 |
+ |
|
| 15 |
+ operations = [ |
|
| 16 |
+ migrations.AddField( |
|
| 17 |
+ model_name='modelinfo', |
|
| 18 |
+ name='image3', |
|
| 19 |
+ field=models.ImageField(blank=True, help_text='\u56fe\u72473', null=True, upload_to=django_models_ext.fileext.upload_path, verbose_name='image3'), |
|
| 20 |
+ ), |
|
| 21 |
+ ] |
@@ -151,6 +151,7 @@ class ModelInfo(BaseModelMixin): |
||
| 151 | 151 |
url = models.CharField(_(u'url'), max_length=255, blank=True, null=True, help_text=u'链接') |
| 152 | 152 |
|
| 153 | 153 |
image2 = models.ImageField(_(u'image2'), upload_to=upload_path, blank=True, null=True, help_text=u'图片2') |
| 154 |
+ image3 = models.ImageField(_(u'image3'), upload_to=upload_path, blank=True, null=True, help_text=u'图片3') |
|
| 154 | 155 |
|
| 155 | 156 |
factory_yuan = models.FloatField(_(u'factory_yuan'), default=1000, help_text=u'出厂价(元)') |
| 156 | 157 |
factory_fee = models.IntegerField(_(u'factory_fee'), default=100000, help_text=u'出厂价(分)') |
@@ -185,6 +186,14 @@ class ModelInfo(BaseModelMixin): |
||
| 185 | 186 |
return upload_file_url(self.image2) |
| 186 | 187 |
|
| 187 | 188 |
@property |
| 189 |
+ def image3_path(self): |
|
| 190 |
+ return upload_file_path(self.image3) |
|
| 191 |
+ |
|
| 192 |
+ @property |
|
| 193 |
+ def image3_url(self): |
|
| 194 |
+ return upload_file_url(self.image3) |
|
| 195 |
+ |
|
| 196 |
+ @property |
|
| 188 | 197 |
def images(self): |
| 189 | 198 |
imgs = [] |
| 190 | 199 |
if self.image: |
@@ -197,6 +206,11 @@ class ModelInfo(BaseModelMixin): |
||
| 197 | 206 |
'image_url2': self.image2_url, |
| 198 | 207 |
'url': self.url or '', |
| 199 | 208 |
}) |
| 209 |
+ if self.image3: |
|
| 210 |
+ imgs.append({
|
|
| 211 |
+ 'image_url3': self.image3_url, |
|
| 212 |
+ 'url': self.url or '', |
|
| 213 |
+ }) |
|
| 200 | 214 |
return imgs |
| 201 | 215 |
|
| 202 | 216 |
@property |