"add-code nl-36 ol-36"> 36
+        migrations.AddField(
37
+            model_name='distributorinfo',
38
+            name='brand_name',
39
+            field=models.CharField(blank=True, help_text='\u54c1\u724c\u540d\u79f0', max_length=255, null=True, verbose_name='brand_name'),
40
+        ),
41
+        migrations.AddField(
42
+            model_name='modelimageinfo',
43
+            name='model_name',
44
+            field=models.CharField(blank=True, help_text='\u578b\u53f7\u540d\u79f0', max_length=255, null=True, verbose_name='model_name'),
45
+        ),
46
+        migrations.AddField(
47
+            model_name='modelinfo',
48
+            name='brand_name',
49
+            field=models.CharField(blank=True, help_text='\u54c1\u724c\u540d\u79f0', max_length=255, null=True, verbose_name='brand_name'),
50
+        ),
51
+    ]

+ 21 - 0
mch/migrations/0006_auto_20180115_0047.py

@@ -0,0 +1,21 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.9 on 2018-01-14 16:47
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+import shortuuidfield.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('mch', '0005_auto_20180115_0021'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AlterField(
17
+            model_name='operatorinfo',
18
+            name='operator_id',
19
+            field=shortuuidfield.fields.ShortUUIDField(blank=True, db_index=True, editable=False, help_text='\u64cd\u4f5c\u5458\u552f\u4e00\u6807\u8bc6', max_length=22, null=True, unique=True),
20
+        ),
21
+    ]

+ 33 - 0
mch/models.py

@@ -6,6 +6,36 @@ from models_ext import BaseModelMixin, upload_file_url, upload_path
6 6
 from shortuuidfield import ShortUUIDField
7 7
 
8 8
 
9
+class OperatorInfo(BaseModelMixin):
10
+    ACTIVATED = 1
11
+    DISABLED = 2
12
+
13
+    USER_STATUS_TUPLE = (
14
+        (ACTIVATED, u'已激活'),
15
+        (DISABLED, u'已禁用'),
16
+    )
17
+
18
+    operator_id = ShortUUIDField(_(u'operator_id'), max_length=32, blank=True, null=True, help_text=u'操作员唯一标识', db_index=True, unique=True)
19
+
20
+    phone = models.CharField(_(u'phone'), max_length=16, blank=True, null=True, help_text=u'操作员电话', db_index=True)
21
+    password = models.CharField(_(u'password'), max_length=255, blank=True, null=True, help_text=u'操作员密码')
22
+    encryption = models.CharField(_(u'encryption'), max_length=255, blank=True, null=True, help_text=u'操作员密码')
23
+
24
+    name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'操作员姓名')
25
+
26
+    brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
27
+    brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
28
+
29
+    user_status = models.IntegerField(_(u'user_status'), choices=USER_STATUS_TUPLE, default=ACTIVATED, help_text=u'操作员状态', db_index=True)
30
+
31
+    class Meta:
32
+        verbose_name = _(u'操作员信息')
33
+        verbose_name_plural = _(u'操作员信息')
34
+
35
+    def __unicode__(self):
36
+        return u'{}-{}'.format(self.name, self.phone)
37
+
38
+
9 39
 class BrandInfo(BaseModelMixin):
10 40
     brand_id = ShortUUIDField(_(u'brand_id'), max_length=32, help_text=u'品牌唯一标识', db_index=True, unique=True)
11 41
     brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
@@ -37,6 +67,7 @@ class BrandInfo(BaseModelMixin):
37 67
 
38 68
 class ModelInfo(BaseModelMixin):
39 69
     brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
70
+    brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
40 71
 
41 72
     model_id = ShortUUIDField(_(u'model_id'), max_length=32, help_text=u'型号唯一标识', db_index=True, unique=True)
42 73
     model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称')
@@ -67,6 +98,7 @@ class ModelInfo(BaseModelMixin):
67 98
 
68 99
 class ModelImageInfo(BaseModelMixin):
69 100
     model_id = models.CharField(_(u'model_id'), max_length=32, blank=True, null=True, help_text=u'型号唯一标识', db_index=True)
101
+    model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称')
70 102
 
71 103
     image = models.ImageField(_(u'image'), upload_to=upload_path, blank=True, null=True, help_text=u'图片')
72 104
     url = models.CharField(_(u'url'), max_length=255, blank=True, null=True, help_text=u'链接')
@@ -94,6 +126,7 @@ class ModelImageInfo(BaseModelMixin):
94 126
 
95 127
 class DistributorInfo(BaseModelMixin):
96 128
     brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
129
+    brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
97 130
 
98 131
     distributor_id = ShortUUIDField(_(u'distributor_id'), max_length=32, help_text=u'经销商唯一标识', db_index=True, unique=True)
99 132
     distributor_name = models.CharField(_(u'distributor_name'), max_length=255, blank=True, null=True, help_text=u'经销商名称')

+ 4 - 0
pai2/settings.py

@@ -314,6 +314,10 @@ LOGIT_RES_FLAG = True
314 314
 # Django-Admin Settings
315 315
 DISABLE_ACTION = False
316 316
 
317
+# KODO 设置
318
+MAKE_PASSWORD_SALT = ''
319
+MAKE_PASSWORD_HASHER = ''
320
+
317 321
 # 错误信息邮件设置
318 322
 # Email address that error messages come from.
319 323
 SERVER_EMAIL = 'kimi@pai.ai'

+ 9 - 0
utils/error/errno_utils.py

@@ -29,6 +29,15 @@ class TourGuideStatusCode(BaseStatusCode):
29 29
     TOURGUIDE_NOT_ACTIVATED = StatusCodeField(400115, 'Tour Guide Not Activated', description=u'导游帐号未激活')
30 30
 
31 31
 
32
+class OperatorStatusCode(BaseStatusCode):
33
+    """ 操作员相关错误码 4002xx """
34
+    OPERATOR_NOT_FOUND = StatusCodeField(400201, 'Operator Not Found', description=u'操作员不存在')
35
+    # 密码
36
+    OPERATOR_PASSWORD_ERROR = StatusCodeField(400202, 'Operator Password Error', description=u'操作员密码错误')
37
+    # 状态
38
+    OPERATOR_NOT_ACTIVATED = StatusCodeField(400215, 'Operator Not Activated', description=u'操作员未激活')
39
+
40
+
32 41
 class UserStatusCode(BaseStatusCode):
33 42
     """ 用户相关错误码  4005xx """
34 43
     USER_NOT_FOUND = StatusCodeField(400501, 'User Not Found', description=u'用户不存在')

kodo - Gogs: Go Git Service

No Description

Kimi.Huang: af3d065b78 Sales 7 years ago
..
algorithm f38d3bf980 Caesar Alg 8 years ago
error af3d065b78 Sales 7 years ago
redis 9e580a4861 r1 7 years ago
shells cefc16fe75 cfg 7 years ago
sql f3cf68f957 Add PAI2_HOME_WX_API for request.weixin 8 years ago
__init__.py 52ce35cbfc add api uuid_init/uuid 10 years ago
admin_utils.py 9e4ac4fd3b Add admin_status for GroupUserInfo 9 years ago
disk_utils.py af2b3f483f change download.html to be generated from download.tmpl.html 10 years ago
group_photo_utils.py 0e7b5eb1af Update order_by of group session photos 9 years ago
message_utils.py 21b4a5403a add api lensman_brief_api 10 years ago
original_CGzC_10a50000c8811190.jpg 680f424408 Update water mark 9 years ago
original_CGzC_10a50000c8811190副本.jpg 4a8b4f8819 add watermark 10 years ago
paiai_96_96.png 4a8b4f8819 add watermark 10 years ago
paiai_water_mark.png 680f424408 Update water mark 9 years ago
price_utils.py 24e345a32f Add price func get_group_photo_price 9 years ago
qiniucdn.py ac03876ce1 qiniu_file_url 9 years ago
rdm_utils.py 4efb7f6f87 Statistic 8 years ago
storage_qiniu_utils.py f2fc73685d Update package django_xxx 8 years ago
storage_utils.py f2fc73685d Update package django_xxx 8 years ago
thumbnail_utils.py 5c9e21b29b add Only Once Function statistic_thumbnail_size to statistic thumbnail size 10 years ago
time_utils.py 511533855d Change oauth to use http 8 years ago
url_utils.py 135c21b40c from models_ext import BaseModelMixin, upload_file_url, upload_path 8 years ago
version_utils.py 13816e8774 Fix Bug: REQUEST 8 years ago
watermark_utils.py 5411626ebe Change watermark position 9 years ago
wx_utils.py 32a7d9ffa0 Update wx relative 9 years ago