perature_src.py
Преглед на файла
@@ -0,0 +1,18 @@
1
+# Generated by Django 3.2.6 on 2021-08-08 11:03
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('equipment', '0004_auto_20210712_0035'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.AddField(
14
+            model_name='thermometermeasureloginfo',
15
+            name='temperature_src',
16
+            field=models.IntegerField(choices=[(1, '接口回调'), (2, 'MQTT')], default=1, help_text='用户体温来源', verbose_name='temperature_src'),
17
+        ),
18
+    ]

+ 10 - 0
equipment/models.py

@@ -148,6 +148,14 @@ class ThermometerMeasureInfo(BaseModelMixin):
148 148
 
149 149
 
150 150
 class ThermometerMeasureLogInfo(BaseModelMixin):
151
+    CALLBACK = 1
152
+    MQTT = 2
153
+
154
+    TEMPERATURE_SRC_TUPLE = (
155
+        (CALLBACK, '接口回调'),
156
+        (MQTT, 'MQTT'),
157
+    )
158
+
151 159
     point_id = models.CharField(_('point_id'), max_length=32, blank=True, null=True, help_text='隔离点唯一标识', db_index=True)
152 160
 
153 161
     macid = models.CharField(_('macid'), max_length=32, blank=True, null=True, help_text='设备号')
@@ -163,6 +171,8 @@ class ThermometerMeasureLogInfo(BaseModelMixin):
163 171
 
164 172
     temperature = models.FloatField(_('temperature'), default=0, help_text='用户体温')
165 173
 
174
+    temperature_src = models.IntegerField(_('temperature_src'), choices=TEMPERATURE_SRC_TUPLE, default=CALLBACK, help_text='用户体温来源')
175
+
166 176
     upload_temperature_info = models.TextField(_('upload_temperature_info'), blank=True, null=True, help_text='测温结果上传信息')
167 177
 
168 178
     class Meta:

+ 1 - 0
requirements.txt

@@ -2,6 +2,7 @@ StatusCode==1.0.0
2 2
 furl==2.1.2
3 3
 jsonfield==3.1.0
4 4
 mysqlclient==2.0.3
5
+paho-mqtt==1.5.1
5 6
 pysnippets==1.1.4
6 7
 requests==2.25.1
7 8
 rlog==0.3

+ 2 - 2
requirements_deploy.txt

@@ -1,3 +1,3 @@
1
-ipdb==0.13.3
2
-ipython==7.18.1
1
+ipdb==0.13.9
2
+ipython==7.26.0
3 3
 uwsgi==2.0.19.1

+ 2 - 2
requirements_dev.txt

@@ -1,2 +1,2 @@
1
-isort==5.4.2
2
-pycodestyle==2.6.0
1
+isort==5.9.3
2
+pycodestyle==2.7.0

+ 1 - 1
thermometer/settings.py

@@ -305,7 +305,7 @@ DJANGO_SHORT_URL_REDIRECT_URL = ''
305 305
 
306 306
 # Django-We Settings
307 307
 DJANGO_WE_QUOTE_OR_NOT = True
308
-DJANGO_WE_MODEL_DISPLAY_OR_NOT = True
308
+DJANGO_WE_MODEL_DISPLAY_OR_NOT = False
309 309
 # Enable Cookie or not
310 310
 # DJANGO_WE_BASE_REDIRECT_SET_COOKIE = False
311 311
 # DJANGO_WE_USERINFO_REDIRECT_SET_COOKIE = True

kodo - Gogs: Go Git Service

Keine Beschreibung

huangqimin: 6d06194a0c SubscribeUserInfo vor 6 Jahren
..
__init__.py 6d06194a0c SubscribeUserInfo vor 6 Jahren