filefield 增加max_length

FFIB лет %!s(int64=2): %!d(string=назад)
Родитель
Сommit
189368f5ed
2 измененных файлов с 28 добавлено и 2 удалено
  1. 26 0
      integral/migrations/0023_auto_20230419_1127.py
  2. 2 2
      integral/models.py

+ 26 - 0
integral/migrations/0023_auto_20230419_1127.py

@@ -0,0 +1,26 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+# Generated by Django 3.2.6 on 2023-04-19 03:27
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
+        ('integral', '0022_saleclerksubmitloginfo_distributor_id'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AlterField(
17
+            model_name='saleclerksubmitloginfo',
18
+            name='code_image',
19
+            field=models.FileField(blank=True, help_text='序列号图片', max_length=255, null=True, upload_to=django_models_ext.fileext.upload_path, verbose_name='code_image'),
20
+        ),
21
+        migrations.AlterField(
22
+            model_name='saleclerksubmitloginfo',
23
+            name='image',
24
+            field=models.FileField(blank=True, help_text='图片', max_length=255, null=True, upload_to=django_models_ext.fileext.upload_path, verbose_name='image'),
25
+        ),
26
+    ]

+ 2 - 2
integral/models.py

@@ -101,8 +101,8 @@ class SaleclerkSubmitLogInfo(BaseModelMixin):
101 101
     lat = models.FloatField(_(u'lat'), default=1.0, help_text=u'纬度')
102 102
     lon = models.FloatField(_(u'lon'), default=1.0, help_text=u'经度')
103 103
 
104
-    image = models.FileField(_(u'image'), upload_to=upload_path, blank=True, null=True, help_text=u'图片')
105
-    code_image = models.FileField(_(u'code_image'), upload_to=upload_path, blank=True, null=True, help_text=u'序列号图片')
104
+    image = models.FileField(_(u'image'), upload_to=upload_path, max_length=255, blank=True, null=True, help_text=u'图片')
105
+    code_image = models.FileField(_(u'code_image'), upload_to=upload_path, max_length=255, blank=True, null=True, help_text=u'序列号图片')
106 106
 
107 107
     has_scan = models.BooleanField(_(u'has_scan'), default=False, help_text=u'是否被消费者扫过')
108 108