|
@@ -160,7 +160,7 @@ class Role(models.Model):
|
|
|
|
|
|
class Device_User(AbstractBaseUser):
|
|
|
userID = models.CharField(blank=True, max_length=32, primary_key=True,
|
|
|
- verbose_name=u'用户ID', unique=True, default=CommonService.getUserID(getUser=True))
|
|
|
+ verbose_name=u'用户ID', unique=True)
|
|
|
role = models.ManyToManyField(to='Role', blank=True, verbose_name=u'用户角色', db_table='user_role')
|
|
|
|
|
|
username = models.CharField(max_length=40, verbose_name=u'用户名', default='', blank=True)
|
|
@@ -294,10 +294,10 @@ class Device_User(AbstractBaseUser):
|
|
|
return self.is_superuser
|
|
|
|
|
|
|
|
|
+# 设备表是建项目开发者设计的,自己看着办
|
|
|
class Device_Info(models.Model):
|
|
|
id = models.CharField(blank=True, max_length=32, primary_key=True)
|
|
|
- userID = models.ForeignKey(Device_User, blank=True, to_field='userID',
|
|
|
- on_delete=models.CASCADE)
|
|
|
+ userID = models.ForeignKey(Device_User, blank=True, to_field='userID', on_delete=models.CASCADE)
|
|
|
NickName = models.CharField(blank=True, max_length=32, verbose_name=u'设备名称')
|
|
|
UID = models.CharField(blank=True, max_length=32, verbose_name=u'设备UID')
|
|
|
SID = models.CharField(blank=True, max_length=32, verbose_name=u'服务器ID')
|
|
@@ -420,14 +420,11 @@ class Equipment_Info(models.Model):
|
|
|
devNickName = models.CharField(blank=True, max_length=32, default='', verbose_name=u'设备昵称')
|
|
|
Channel = models.IntegerField(null=True, blank=True, verbose_name=u'设备通道')
|
|
|
eventType = models.IntegerField(null=True, blank=True, verbose_name=u'事件类型')
|
|
|
- viewAccont = models.CharField(blank=True, null=True, max_length=32, verbose_name=u'设备账户')
|
|
|
- viewPwd = models.CharField(blank=True, null=True, max_length=32, verbose_name=u'设备密码')
|
|
|
status = models.BooleanField(blank=True, default=False, verbose_name=u'事件状态')
|
|
|
alarm = models.CharField(blank=True, max_length=256, verbose_name=u'报警信息')
|
|
|
eventTime = models.CharField(blank=True, null=True, max_length=16, verbose_name=u'设备报警时间')
|
|
|
receiveTime = models.CharField(blank=True, null=True, max_length=16, verbose_name=u'接收到报警时间')
|
|
|
- userID = models.ForeignKey(Device_User, null=True, blank=True, to_field='userID',
|
|
|
- on_delete=models.CASCADE)
|
|
|
+ userID = models.ForeignKey(Device_User, null=True, blank=True, to_field='userID', on_delete=models.CASCADE)
|
|
|
|
|
|
def __str__(self):
|
|
|
return self.id
|
|
@@ -445,7 +442,7 @@ class Feedback_Info(models.Model):
|
|
|
status = models.BooleanField(blank=True, default=False, verbose_name=u'状态:0未解决/解决')
|
|
|
content = models.TextField(blank=True, null=True, verbose_name=u'反馈描述')
|
|
|
add_time = models.DateTimeField(blank=True, null=True, verbose_name=u'加入时间/反馈时间', auto_now_add=True)
|
|
|
- update_time = models.DateTimeField(blank=True, null=True,verbose_name=u'更新时间', auto_now=True)
|
|
|
+ update_time = models.DateTimeField(blank=True, null=True, verbose_name=u'更新时间', auto_now=True)
|
|
|
|
|
|
def __str__(self):
|
|
|
return self.id
|
|
@@ -515,7 +512,7 @@ class Equipment_Version(models.Model):
|
|
|
fileMd5 = models.CharField(blank=True, max_length=32, null=True, verbose_name=u'上传文件MD5加密')
|
|
|
status = models.BooleanField(blank=True, default=True, verbose_name=u'是否开启更新状态')
|
|
|
update_time = models.DateTimeField(blank=True, verbose_name=u'更新时间', auto_now=True)
|
|
|
- lang = models.CharField(blank=True,default='en', max_length=32, verbose_name=u'ota包内置语言')
|
|
|
+ lang = models.CharField(blank=True, default='en', max_length=32, verbose_name=u'ota包内置语言')
|
|
|
|
|
|
def __str__(self):
|
|
|
return self.eid
|
|
@@ -547,3 +544,52 @@ class App_Info(models.Model):
|
|
|
verbose_name = u'app信息表'
|
|
|
verbose_name_plural = verbose_name
|
|
|
ordering = ('id',)
|
|
|
+
|
|
|
+
|
|
|
+# class UID_Model(models.Model):
|
|
|
+# id = models.AutoField(primary_key=True, verbose_name=u'自增标记ID')
|
|
|
+# UID = models.CharField(blank=True, unique=True, max_length=32, verbose_name=u'设备UID')
|
|
|
+# NickName = models.CharField(blank=True, max_length=32, verbose_name=u'设备名称')
|
|
|
+# SID = models.CharField(blank=True, max_length=32, verbose_name=u'服务器ID')
|
|
|
+# View_Account = models.CharField(blank=True, max_length=32, verbose_name=u'设备用户名称')
|
|
|
+# View_Password = models.CharField(blank=True, max_length=32, verbose_name=u'设备密码')
|
|
|
+# AudioFormat = models.IntegerField(blank=True, default=1, verbose_name=u'初始化影像')
|
|
|
+# EventNotification = models.IntegerField(blank=True, verbose_name=u'报警类型')
|
|
|
+# ChannelIndex = models.IntegerField(blank=True, verbose_name=u'通道号')
|
|
|
+# Online = models.BooleanField(blank=True, default=False, verbose_name=u'设备是否在线')
|
|
|
+# mMonitorIndex = models.IntegerField(blank=True, default=-1)
|
|
|
+# Type = models.IntegerField(blank=True)
|
|
|
+# DebugMode = models.IntegerField(blank=True, verbose_name=u'调试模式')
|
|
|
+# NotificationMode = models.IntegerField(blank=True, verbose_name=u'是否报警')
|
|
|
+# qvgaLevel = models.BooleanField(blank=True, verbose_name=u'SD与HD画面', default=0) # 0代表:SD、1代表:HD
|
|
|
+# isShare = models.BooleanField(blank=True, verbose_name=u'共享设备', default=False)
|
|
|
+# primaryUserID = models.CharField(blank=True, verbose_name='主用户', max_length=32, default='')
|
|
|
+# data_joined = models.DateTimeField(blank=True, verbose_name=u'设备添加时间', auto_now_add=True)
|
|
|
+# update_time = models.DateTimeField(blank=True, verbose_name=u'更新时间', auto_now=True, null=True)
|
|
|
+# ip = models.CharField(blank=True, max_length=20, null=True, verbose_name=u'设备区域ip')
|
|
|
+# area = models.CharField(blank=True, max_length=100, null=True, verbose_name=u'设备区域area')
|
|
|
+# # ios要求新增字段
|
|
|
+# version = models.CharField(blank=True, max_length=20, null=True, verbose_name=u'版本号')
|
|
|
+# SpaceUsable = models.CharField(blank=True, max_length=20, null=True, verbose_name=u'可用空间')
|
|
|
+# SpaceSum = models.CharField(blank=True, max_length=20, null=True, verbose_name=u'总空间')
|
|
|
+# WIFIName = models.CharField(blank=True, max_length=50, null=True, verbose_name=u'无线名称')
|
|
|
+# WIFIIP = models.CharField(blank=True, max_length=20, null=True, verbose_name=u'无线ip')
|
|
|
+# WIFIPwd = models.CharField(blank=True, max_length=50, null=True, verbose_name=u'无线密码')
|
|
|
+# isDetector = models.BooleanField(blank=True, verbose_name=u'侦测开关', default=False) # 0:关闭,1:开启
|
|
|
+# DetectorRank = models.IntegerField(blank=True, default=0, verbose_name=u'侦测灵敏度') # 1:低,2:中,3:高4:最高
|
|
|
+# iSNotification = models.BooleanField(blank=True, verbose_name=u'报警通知', default=False) # 0:关闭,1:开启)
|
|
|
+# MirrorType = models.IntegerField(blank=True, default=0, verbose_name=u'镜像类型') # 0:关闭镜像,1:上下镜像,2:左右镜像,3:上下左右镜像
|
|
|
+# RecordType = models.IntegerField(blank=True, default=0, verbose_name=u'录像模式') # (0:关闭,1:全是录像,3:报警录像)
|
|
|
+# TimeZone = models.CharField(blank=True, max_length=50, null=True, verbose_name=u'时区')
|
|
|
+# user_model = models.ManyToManyField(to='Device_User', blank=True, verbose_name=u'用户关联设备', db_table='user_uid')
|
|
|
+#
|
|
|
+# REQUIRED_FIELDS = []
|
|
|
+#
|
|
|
+# def __str__(self):
|
|
|
+# return self.NickName
|
|
|
+#
|
|
|
+# class Meta:
|
|
|
+# db_table = 'UID'
|
|
|
+# ordering = ('-data_joined',)
|
|
|
+# verbose_name = u'设备信息表'
|
|
|
+# verbose_name_plural = verbose_name
|