37
|
+ user_id = models.CharField(_('user_id'), max_length=32, blank=True, null=True, help_text='用户唯一标识')
|
|
38
|
+
|
|
39
|
+ temperature = models.FloatField(_('temperature'), default=0, help_text='用户体温')
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+ class Meta:
|
|
43
|
+ verbose_name = _('家用测温记录信息')
|
|
44
|
+ verbose_name_plural = _('家用测温记录信息')
|
|
45
|
+
|
|
46
|
+ def __unicode__(self):
|
|
47
|
+ return self.pk
|
|
48
|
+
|
|
49
|
+ @property
|
|
50
|
+ def data(self):
|
|
51
|
+ return {
|
|
52
|
+ 'macid': self.macid,
|
|
53
|
+ 'user_id': self.user_id,
|
|
54
|
+ 'temperature': self.temperature,
|
|
55
|
+ 'created_at': tc.local_string(utc_dt=self.created_at),
|
|
56
|
+ }
|
|
|
@@ -0,0 +1,3 @@
|
|
1
|
+from django.test import TestCase
|
|
2
|
+
|
|
3
|
+# Create your tests here.
|
|
|
@@ -0,0 +1,3 @@
|
|
1
|
+from django.shortcuts import render
|
|
2
|
+
|
|
3
|
+# Create your views here.
|
|
|
@@ -58,6 +58,7 @@ INSTALLED_APPS = [
|
58
|
58
|
'api',
|
59
|
59
|
'account',
|
60
|
60
|
'equipment',
|
|
61
|
+ 'household',
|
61
|
62
|
]
|
62
|
63
|
|
63
|
64
|
MIDDLEWARE = [
|