コード例 #1
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #2
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #3
0
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
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
コード例 #7
0
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
コード例 #8
0
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
コード例 #9
0
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
コード例 #10
0
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))
コード例 #11
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #12
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #13
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #14
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #15
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #16
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #17
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #18
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #19
0
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'))
コード例 #20
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #21
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #22
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #23
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #24
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #25
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #26
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #27
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #28
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #29
0
ファイル: model.py プロジェクト: NeilWang6/case
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'
コード例 #30
0
ファイル: model.py プロジェクト: NeilWang6/case
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'