Add SysConfig

Brightcells 7 years ago
parent
commit
4747b20744
9 changed files with 54 additions and 1 deletions
  1. 0 1
      area/models.py
  2. 0 0
      config/__init__.py
  3. 13 0
      config/admin.py
  4. 8 0
      config/apps.py
  5. 0 0
      config/migrations/__init__.py
  6. 18 0
      config/models.py
  7. 7 0
      config/tests.py
  8. 7 0
      config/views.py
  9. 1 0
      tamrondb/settings.py

+ 0 - 1
area/models.py

@@ -2,7 +2,6 @@
2 2
 
3 3
 from django.db import models
4 4
 from django.utils.translation import ugettext_lazy as _
5
-from models_ext import upload_path
6 5
 
7 6
 
8 7
 class TamronCitiesInfo(models.Model):

+ 0 - 0
config/__init__.py


+ 13 - 0
config/admin.py

@@ -0,0 +1,13 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from djadmin import ExportExcelModelAdmin, ReadonlyModelAdmin
4
+from django.contrib import admin
5
+
6
+from config.models import TamronSysConfigInfo
7
+
8
+
9
+class TamronSysConfigInfoAdmin(admin.ModelAdmin):
10
+    list_display = ('varname', 'info', 'value')
11
+
12
+
13
+admin.site.register(TamronSysConfigInfo, TamronSysConfigInfoAdmin)

+ 8 - 0
config/apps.py

@@ -0,0 +1,8 @@
1
+# -*- coding: utf-8 -*-
2
+from __future__ import unicode_literals
3
+
4
+from django.apps import AppConfig
5
+
6
+
7
+class ConfigConfig(AppConfig):
8
+    name = 'config'

+ 0 - 0
config/migrations/__init__.py


+ 18 - 0
config/models.py

@@ -0,0 +1,18 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from django.db import models
4
+from django.utils.translation import ugettext_lazy as _
5
+
6
+
7
+class TamronSysConfigInfo(models.Model):
8
+    varname = models.CharField(_(u'varname'), max_length=100, blank=True, null=True, help_text=u'变量名')
9
+    info = models.CharField(_(u'info'), max_length=45, blank=True, null=True, help_text=u'中文名')
10
+    value = models.CharField(_(u'value'), max_length=455, blank=True, null=True, help_text=u'变量值')
11
+
12
+    class Meta:
13
+        verbose_name = _(u'系统配置信息')
14
+        verbose_name_plural = _(u'系统配置信息')
15
+        db_table = 'shidu_sysconfig'
16
+
17
+    def __unicode__(self):
18
+        return unicode(self.pk)

+ 7 - 0
config/tests.py

@@ -0,0 +1,7 @@
1
+# -*- coding: utf-8 -*-
2
+from __future__ import unicode_literals
3
+
4
+from django.test import TestCase
5
+
6
+
7
+# Create your tests here.

+ 7 - 0
config/views.py

@@ -0,0 +1,7 @@
1
+# -*- coding: utf-8 -*-
2
+from __future__ import unicode_literals
3
+
4
+from django.shortcuts import render
5
+
6
+
7
+# Create your views here.

+ 1 - 0
tamrondb/settings.py

@@ -42,6 +42,7 @@ INSTALLED_APPS = [
42 42
     'django.contrib.messages',
43 43
     'django.contrib.staticfiles',
44 44
     'area',
45
+    'config',
45 46
     'tamron',
46 47
 ]
47 48