class TrendPusher(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) date = db.Column(db.Date) windowsize = db.Column(db.Integer, default=1) uid = db.Column(db.BigInteger(11, unsigned=True)) timestamp = db.Column(db.BigInteger(20, unsigned=True)) user_info = db.Column(db.Text) weibo_info = db.Column(db.Text) domain = db.Column(db.String(20)) rank = db.Column(db.Integer) def __init__(self, topic, date, windowsize, uid, timestamp, user_info, weibo_info, domain, rank): self.topic = topic self.date = date self.windowsize = windowsize self.uid = uid self.timestamp = timestamp self.user_info = user_info self.weibo_info = weibo_info self.domain = domain self.rank = rank @classmethod def _name(cls): return u'TrendPusher'
class IndexTopic(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.Text) count = db.Column(db.Integer) # 微博数 user_count = db.Column(db.Integer) # 用户数 begin = db.Column(db.BigInteger(10, unsigned=True)) # 起始时间 end = db.Column(db.BigInteger(10, unsigned=True)) # 终止时间 area = db.Column(db.Text) # 地理区域 key_words = db.Column(db.Text) # 关键词 opinion = db.Column(db.Text) # 代表文本 media_opinion = db.Column(db.Text) # 媒体观点 def __init__(self, topic, count, user_count, begin, end, area, key_words, opinion, media_opinion): self.topic = topic self.count = count self.user_count = user_count self.begin = begin self.end = end self.area = area self.key_words = key_words self.opinion = opinion self.media_opinion = media_opinion @classmethod def _name(cls): return u'IndexTopic'
class Topics(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(20, unsigned=True)) end_ts = db.Column(db.BigInteger(20, unsigned=True)) def __init__(self, topic, start_ts, end_ts): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts
class QuotaDuration(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) duration = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, duration): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.duration = duration
class QuotaImportance(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) score = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, score): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.score = score # 0<=score<1
class OpinionTestTime(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) child_topic = db.Column(db.Text) start_ts = db.Column(db.BigInteger(20, unsigned=True)) end_ts = db.Column(db.BigInteger(20, unsigned=True)) def __init__(self, topic, child_topic, start_ts, end_ts): self.topic = topic self.child_topic = child_topic self.start_ts = start_ts self.end_ts = end_ts
class QuotaSentiment(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) sentiment = db.Column(db.Integer(1, unsigned=True)) ratio = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, sentiment, ratio): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.sentiment = sentiment self.ratio = ratio
class QuotaQuickness(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) domain = db.Column(db.String(20)) quickness = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, domain, quickness): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.domain = domain self.quickness = quickness
class QuotaSensitivity(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) classfication = db.Column(db.Integer( 1, unsigned=True)) # ['category':1, 'word':2, 'place':3] score = db.Column(db.Float) # 1<=score<=5 def __init__(self, topic, start_ts, end_ts, classfication, score): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.classfication = classfication self.score = score
class Shipper(db.Model): __tablename__ = 'shippers' shipperID = db.Column(db.Integer(), primary_key=True) companyName = db.Column(db.String(64), nullable=False) phone = db.Column(db.BigInteger(), nullable=False) email = db.Column(db.String(255)) contactName = db.Column(db.String(64))
class QuotaIndex(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) index = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, index): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.index = index @classmethod def _name(cls): return u'QuotaIndex'
class CoverageExp(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) coverage_exp = db.Column(db.Integer) def __init__(self, topic, start_ts, end_ts, coverage_exp): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.coverage_exp = coverage_exp @classmethod def _name(cls): return u'CoverageExp'
class PlaceSensitivity(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) words = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, words): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.words = words @classmethod def _name(cls): return u'PlaceSensitivity'
class QuotaPersonSensitivity(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) pr = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, pr): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.pr = pr @classmethod def _name(cls): return u'QuotaPersonSensitivity'
class QuotaSentiment(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) sratio = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, sratio): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.sratio = sratio @classmethod def _name(cls): return u'QuotaSentiment'
class QuotaGeoPenetration(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) pcount = db.Column(db.Text) def __init__(self, topic, start_ts, end_ts, pcount): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.pcount = pcount @classmethod def _name(cls): return u'QuotaGeoPenetration'
class QuotaMediaImportance(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) media_importance = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, media_importance): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.media_importance = media_importance @classmethod def _name(cls): return u'QuotaMediaImportance'
class QuotaFInvolved(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) f_involved = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, f_involved): self.topic = topic self, start_ts = start_ts self.end_ts = end_ts self.f_involved = f_involved @classmethod def _name(cls): return u'QuotaFInvolved'
class Supplier(db.Model): __tablename__ = 'suppliers' supplierID = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(128), index=True) phone = db.Column(db.BigInteger(), nullable=False) email = db.Column(db.String(255), unique=True, index=True) customer_ID = db.Column(db.Integer(), db.ForeignKey('customers.customerID'))
class QuotaImportance(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) score = db.Column(db.Float) weight = db.Column(db.Float) # 0<=weight<=1 def __init__(self, topic, start_ts, end_ts, score, weight): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.score = score # 0<=score<1 self.weight = weight @classmethod def _name(cls): return u'QuotaImportance'
class PropagateCountNews(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) end = db.Column(db.BigInteger(10, unsigned=True)) range = db.Column(db.BigInteger(10, unsigned=True)) mtype = db.Column(db.Integer(1, unsigned=True)) dcount = db.Column(db.Text) # dcount={'other':count}领域对应的count def __init__(self, topic, range, end, mtype, dcount): self.topic = topic self.range = range self.end = end self.mtype = mtype self.dcount = dcount @classmethod def _name(cls): return u'PropagateCountNews'
class QuotaAttentionExp(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) exp = db.Column( db.Text ) # exp={'media':x1, 'other':x2, 'opinion_leader':x3, 'oversea':x4, 'folk':x5} def __init__(self, topic, start_ts, end_ts, exp): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.exp = exp @classmethod def _name(cls): return u'QuotaAttentionExp'
class QuotaAttention(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) domain = db.Column(db.String(20)) attention = db.Column(db.Float) def __init__(self, topic, start_ts, end_ts, domain, attention): self.topic = topic self.start_ts = start_ts self.end_ts = end_ts self.domain = domain self.attention = attention @classmethod def _name(cls): return u'QuotaAttention'
class SentimentCount(db.Model): #情绪绝对数量曲线--已改 id = db.Column(db.Integer, primary_key=True, autoincrement=True) query = db.Column(db.String(20)) end = db.Column(db.BigInteger(10, unsigned=True)) range = db.Column(db.BigInteger(10, unsigned=True)) sentiment = db.Column(db.Integer(1, unsigned=True)) count = db.Column(db.BigInteger(20, unsigned=True)) def __init__(self, query, range, end, sentiment, count): self.query = query self.range = range self.end = end self.sentiment = sentiment self.count = count @classmethod def _name(cls): return u'SentimentCount'
class NewTopicStatus(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) module = db.Column(db.String(20)) start_ts = db.Column(db.BigInteger(10, unsigned=True)) end_ts = db.Column(db.BigInteger(10, unsigned=True)) category = db.Column(db.String(20)) db_date = db.Column(db.Date) status = db.Column(db.Integer) def __init__(self, module, start_ts, end_ts, category, db_date, status): self.module = module self.start_ts = start_ts self.end_ts = end_ts self.category = category self.db_date = db_date self.status = status @classmethod def _name(cls): return u'NewTopicStatus'
class PropagateKeywords(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) end = db.Column(db.BigInteger(10, unsigned=True)) range = db.Column(db.BigInteger(10, unsigned=True)) mtype = db.Column(db.Integer(1, unsigned=True)) limit = db.Column(db.BigInteger(10, unsigned=True), primary_key=True) kcount = db.Column(db.Text) # kcount=[terms] def __init__(self, topic, end, range, mtype, limit, kcount): self.topic = topic self.end = end self.range = range self.limit = limit self.mtype = mtype self.kcount = kcount @classmethod def _name(cls): return u'PropagateKeywords'
class PropagateNews(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) end = db.Column(db.BigInteger(10, unsigned=True)) range = db.Column(db.BigInteger(10, unsigned=True)) mtype = db.Column(db.Integer(1, unsigned=True)) limit = db.Column(db.BigInteger(10, unsigned=True), primary_key=True) news = db.Column(db.Text) # news=[news] def __init__(self, topic, end, range, mtype, limit, news): self.topic = topic self.end = end self.range = range self.mtype = mtype self.limit = limit self.news = news @classmethod def _name(cls): return u'PropagateNews'
class SentimentWeibos(db.Model): #情绪微博--已改 id = db.Column(db.Integer, primary_key=True, autoincrement=True) query = db.Column(db.String(20)) end = db.Column(db.BigInteger(10, unsigned=True)) range = db.Column(db.BigInteger(10, unsigned=True)) limit = db.Column(db.BigInteger(10, unsigned=True)) sentiment = db.Column(db.Integer(1, unsigned=True)) weibos = db.Column(db.Text) def __init__(self, query, range, limit, end, sentiment, weibos): self.query = query self.range = range self.limit = limit self.end = end self.sentiment = sentiment self.weibos = weibos @classmethod def _name(cls): return u'SentimentWeibos'
class LocalBridge(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) date = db.Column(db.Date) windowsize = db.Column(db.Integer, default=1) a_node = db.Column(db.BigInteger(11, unsigned=True)) b_node = db.Column(db.BigInteger(11, unsigned=True)) span_ab = db.Column(db.Integer) def __init__(self, topic, date, windowsize, a_node, b_node, span_ab): self.topic = topic self.date = date self.windowsize = windowsize self.a_node = a_node self.b_node = b_node self.span_ab = span_ab @classmethod def _name(cls): return u'LocalBridge'
class CityTopicCount(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) topic = db.Column(db.String(20)) end = db.Column(db.BigInteger(10, unsigned=True)) range = db.Column(db.BigInteger(10, unsigned=True)) mtype = db.Column(db.Integer(1, unsigned=True)) #message_type:原创-1、转发-2、评论-3 ccount = db.Column(db.Text) #city_count:{city:count} first_item = db.Column(db.Text) # 原创 初始微博 其他类型为空 def __init__(self, topic, range, end, mtype, ccount, first_item): self.topic = query self.range = range self.end = end self.mtype = mtype self.ccount = ccount self.first_item = first_item @classmethod def _name(cls): return u'CityTopicCount'