:art: Opt sex & Opt site_header

Kimi.Huang преди 5 години
родител
ревизия
16a5e673aa
променени са 4 файла, в които са добавени 10 реда и са изтрити 16 реда
  1. 5 5
      account/models.py
  2. 2 10
      guideline/models.py
  3. 2 0
      kodo/settings.py
  4. 1 1
      kodo/urls.py

+ 5 - 5
account/models.py

@@ -2,7 +2,7 @@
2 2
 
3 3
 from django.db import models
4 4
 from django.utils.translation import ugettext_lazy as _
5
-from django_models_ext import BaseModelMixin
5
+from django_models_ext import BaseModelMixin, SexModelMixin
6 6
 from jsonfield import JSONField
7 7
 
8 8
 from kodo.basemodels import LensmanTypeBoolMixin
@@ -43,7 +43,7 @@ class LensmanInfo(BaseModelMixin, LensmanTypeBoolMixin):
43 43
     encryption = models.CharField(_(u'encryption'), max_length=255, blank=True, null=True, help_text=u'摄影师密码')
44 44
 
45 45
     name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'摄影师姓名')
46
-    sex = models.IntegerField(_(u'sex'), choices=SEX_TYPE, default=MALE, help_text=u'摄影师性别')
46
+    sex = models.IntegerField(_(u'sex'), choices=SexModelMixin.SEX_TUPLE, default=SexModelMixin.UNKNOWN, help_text=u'摄影师性别')
47 47
     phone = models.CharField(_(u'phone'), max_length=11, blank=True, null=True, help_text=u'摄影师电话', db_index=True)
48 48
     location = models.CharField(_(u'location'), max_length=255, blank=True, null=True, help_text=u'摄影师地址')
49 49
 
@@ -181,7 +181,7 @@ class TourGuideInfo(BaseModelMixin):
181 181
     unionid = models.CharField(_(u'unionid'), max_length=32, blank=True, null=True, help_text=u'微信 Union ID', db_index=True, unique=True)
182 182
 
183 183
     name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'导游姓名')
184
-    sex = models.IntegerField(_(u'sex'), choices=SEX_TYPE, default=MALE, help_text=u'导游性别')
184
+    sex = models.IntegerField(_(u'sex'), choices=SexModelMixin.SEX_TUPLE, default=SexModelMixin.UNKNOWN, help_text=u'导游性别')
185 185
     phone = models.CharField(_(u'phone'), max_length=11, blank=True, null=True, help_text=u'导游电话', db_index=True)
186 186
     location = models.CharField(_(u'location'), max_length=255, blank=True, null=True, help_text=u'导游地址')
187 187
 
@@ -230,7 +230,7 @@ class WechatInfo(BaseModelMixin):
230 230
 
231 231
     unionid = models.CharField(_(u'unionid'), max_length=32, blank=True, null=True, help_text=u'微信 Union ID')
232 232
     openids = JSONField(_(u'openids'), blank=True, null=True, help_text=u'微信 Open IDs')
233
-    sex = models.IntegerField(_(u'sex'), choices=SEX_TYPE, default=MALE, help_text=u'用户性别')
233
+    sex = models.IntegerField(_(u'sex'), choices=SexModelMixin.SEX_TUPLE, default=SexModelMixin.UNKNOWN, help_text=u'用户性别')
234 234
     nickname = models.CharField(_(u'nickname'), max_length=255, blank=True, null=True, help_text=u'用户昵称')
235 235
     headimgurl = models.CharField(_(u'headimgurl'), max_length=255, blank=True, null=True, help_text=u'用户头像')
236 236
     country = models.CharField(_(u'country'), max_length=255, blank=True, null=True, help_text=u'用户国家')
@@ -305,7 +305,7 @@ class UserInfo(BaseModelMixin, LensmanTypeBoolMixin):
305 305
     openid_oauth = models.CharField(_(u'openid_oauth'), max_length=32, blank=True, null=True, help_text=u'微信 Openid,拍爱用户授权', db_index=True, unique=True)
306 306
     # 用户基本信息
307 307
     name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'用户姓名')
308
-    sex = models.IntegerField(_(u'sex'), choices=SEX_TYPE, default=MALE, help_text=u'用户性别')
308
+    sex = models.IntegerField(_(u'sex'), choices=SexModelMixin.SEX_TUPLE, default=SexModelMixin.UNKNOWN, help_text=u'用户性别')
309 309
     nickname = models.CharField(_(u'nickname'), max_length=255, blank=True, null=True, help_text=u'用户昵称')
310 310
     avatar = models.CharField(_(u'avatar'), max_length=255, blank=True, null=True, help_text=u'用户头像')
311 311
     phone = models.CharField(_(u'phone'), max_length=11, blank=True, null=True, help_text=u'用户电话', db_index=True)

+ 2 - 10
guideline/models.py

@@ -2,19 +2,11 @@
2 2
 
3 3
 from django.db import models
4 4
 from django.utils.translation import ugettext_lazy as _
5
-from django_models_ext import BaseModelMixin
5
+from django_models_ext import BaseModelMixin, SexModelMixin
6 6
 from shortuuidfield import ShortUUIDField
7 7
 
8 8
 
9 9
 class ScreenAdminInfo(BaseModelMixin):
10
-    MALE = 1
11
-    FEMALE = 0
12
-
13
-    SEX_TYPE_TUPLE = (
14
-        (MALE, u'男'),
15
-        (FEMALE, u'女'),
16
-    )
17
-
18 10
     ACTIVATED = 1
19 11
     DISABLED = 2
20 12
     DELETED = 3
@@ -31,7 +23,7 @@ class ScreenAdminInfo(BaseModelMixin):
31 23
     openid = models.CharField(_(u'openid'), max_length=32, blank=True, null=True, help_text=u'微信 Open ID', db_index=True)
32 24
 
33 25
     name = models.CharField(_(u'name'), max_length=8, blank=True, null=True, help_text=u'用户姓名')
34
-    sex = models.IntegerField(_(u'sex'), choices=SEX_TYPE_TUPLE, default=MALE, help_text=u'用户性别')
26
+    sex = models.IntegerField(_(u'sex'), choices=SexModelMixin.SEX_TUPLE, default=SexModelMixin.UNKNOWN, help_text=u'用户性别')
35 27
     nickname = models.CharField(_(u'nickname'), max_length=255, blank=True, null=True, help_text=u'用户昵称')
36 28
     avatar = models.CharField(_(u'avatar'), max_length=255, blank=True, null=True, help_text=u'用户头像')
37 29
     phone = models.CharField(_(u'phone'), max_length=11, blank=True, null=True, help_text=u'用户电话', db_index=True)

+ 2 - 0
kodo/settings.py

@@ -391,6 +391,8 @@ DJANGO_WE_COMPONENT_CALLBACK_TEMPLATE = 'page/preauth/preauth_success.html'
391 391
 # Test Settings
392 392
 DEBUG_STATISTIC_DATA_FLAG = False
393 393
 
394
+KODO_BRAND_NAME = ''
395
+
394 396
 KODO_DEFAULT_BRAND_PK = 0
395 397
 KODO_DEFAULT_BRAND_ID = ''
396 398
 KODO_DEFAULT_BRAND_NAME = ''

+ 1 - 1
kodo/urls.py

@@ -102,4 +102,4 @@ urlpatterns += [
102 102
 urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
103 103
 urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
104 104
 
105
-admin.site.site_header = u'[盈多]腾龙后台管理系统'
105
+admin.site.site_header = u'[盈多]{}后台管理系统'.format(settings.KODO_BRAND_NAME)