新聞中心

EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 解析Dragonboard 410c搭載web服務(wù)器之?dāng)?shù)據(jù)庫(kù)的設(shè)計(jì)

解析Dragonboard 410c搭載web服務(wù)器之?dāng)?shù)據(jù)庫(kù)的設(shè)計(jì)

作者: 時(shí)間:2018-08-06 來(lái)源:網(wǎng)絡(luò) 收藏

本文引用地址:http://butianyuan.cn/article/201808/385374.htm

#text=models.CharField(max_length=254, unique=True, db_index=True)

is_staff = models.BooleanField('staff status', default=False)

# userID = models.IntegerField(default=1) #用戶獨(dú)有的ID

# is_active = models.BooleanField('active', default=True)

# got = models.CharField(max_length=254,default=username)

# to = models.CharField(max_length=254,default=username)

# message_flag = models.CharField(max_length=254, default=1)

# text = models.CharField(max_length=254, default=)

# video = models.CharField(max_length=254,default=)

# time = models.CharField(max_length=254,default=)

USERNAME_FIELD = 'username'

# REQUIRED_FIELDS = ['email']

objects = MyUserManager()

class Meta:

db_table = 'myuser'

# def get_full_name(self):

# return self.username

# def get_short_name(self):

# return self.username

#建立推送消息的模型

class Message(models.Model):

# username = models.CharField(max_length=254) #消息推送者的名字

ownerID = models.IntegerField(default=1)

pushID = models.IntegerField(default=1)

infoType = models.IntegerField(default=0)

infoSubject = models.CharField(max_length=254)

infoContent = models.CharField(max_length=254)

filePath = models.CharField(max_length=1000)

pushTim = models.CharField(max_length=254)

infoValidityTime = models.CharField(max_length=254)

isTop = models.IntegerField(default=0)

viewWeight = models.IntegerField(default=1)

def __unicode__(self):

# 在Python3中使用 def __str__(self)

return self.name

class SystemStatus(models.Model): #實(shí)例化對(duì)象:online_message MMDB.updateSystemStatus('peopleInfront',-1,0,'no people in front')

statusName = models.CharField(max_length=30,default=peopleInfront)

statusValue = models.IntegerField(default=-1)

statusParam = models.IntegerField(default=0)

statusDiscirption = models.CharField(max_length=50,default=no people in front)

def __unicode__(self):

# 在Python3中使用 def __str__(self)

return self.name

三.例程分享:http://pan.baidu.com/share/link?shareid=3536829173uk=1812979481


上一頁(yè) 1 2 下一頁(yè)

評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉