How to use longText method in fMBT

Best Python code snippet using fMBT_python

models.py

Source:models.py Github

copy

Full Screen

1# coding: utf-82from sqlalchemy import Column, DateTime, Index, String, Text, text3from sqlalchemy.dialects.mysql import DATETIME, INTEGER, LONGTEXT, SMALLINT, TINYINT, VARCHAR4from sqlalchemy.ext.declarative import declarative_base5Base = declarative_base()6metadata = Base.metadata7class Adminuser(Base):8 __tablename__ = 'adminuser'9 id = Column(INTEGER(11), primary_key=True)10 first_name = Column(VARCHAR(255), nullable=False)11 last_name = Column(VARCHAR(255), nullable=False)12 login = Column(VARCHAR(80), nullable=False, unique=True)13 email = Column(VARCHAR(255), nullable=False, unique=True)14 password = Column(VARCHAR(255), nullable=False)15 active = Column(TINYINT(1), nullable=False)16 confirmed_at = Column(DATETIME(fsp=6), nullable=False)17class Allcomment(Base):18 __tablename__ = 'allcomment'19 id = Column(INTEGER(11), primary_key=True)20 commrnt_content = Column(VARCHAR(128), nullable=False)21 commentator = Column(VARCHAR(32), nullable=False)22 comment_time = Column(VARCHAR(32), nullable=False)23 is_interesting = Column(TINYINT(1), nullable=False)24 comment_label = Column(INTEGER(11), nullable=False)25 event_id = Column(INTEGER(11), nullable=False)26class Article(Base):27 __tablename__ = 'article'28 id = Column(INTEGER(11), primary_key=True)29 label_id = Column(INTEGER(11))30 title = Column(VARCHAR(128))31 create_time = Column(DATETIME(fsp=6), nullable=False)32 release_time = Column(DATETIME(fsp=6), nullable=False)33 release_state = Column(INTEGER(11), nullable=False)34 read_amount = Column(INTEGER(11), nullable=False)35 data = Column(LONGTEXT)36 share_image_url = Column(VARCHAR(32))37 source = Column(VARCHAR(128))38 url = Column(VARCHAR(128))39class ArticleManySource(Base):40 __tablename__ = 'article_many_source'41 id = Column(INTEGER(11), primary_key=True)42 source_id = Column(INTEGER(11))43 article_id = Column(INTEGER(11))44class AuthGroup(Base):45 __tablename__ = 'auth_group'46 id = Column(INTEGER(11), primary_key=True)47 name = Column(VARCHAR(80), nullable=False, unique=True)48class AuthUser(Base):49 __tablename__ = 'auth_user'50 id = Column(INTEGER(11), primary_key=True)51 password = Column(String(128), nullable=False)52 last_login = Column(DATETIME(fsp=6))53 is_superuser = Column(TINYINT(1), nullable=False)54 username = Column(String(150), nullable=False, unique=True)55 first_name = Column(String(30), nullable=False)56 last_name = Column(String(150), nullable=False)57 email = Column(String(254), nullable=False)58 is_staff = Column(TINYINT(1), nullable=False)59 is_active = Column(TINYINT(1), nullable=False)60 date_joined = Column(DATETIME(fsp=6), nullable=False)61class Baike(Base):62 __tablename__ = 'baike'63 id = Column(INTEGER(11), primary_key=True)64 yiming = Column(VARCHAR(64))65 zhongwenming = Column(VARCHAR(32))66 waiwenming = Column(VARCHAR(64))67 cengyongming = Column(VARCHAR(64))68 chuohao = Column(VARCHAR(64))69 waihao = Column(VARCHAR(64))70 ribenyiming = Column(VARCHAR(64))71 yuanyiming = Column(VARCHAR(64))72 chenghu = Column(VARCHAR(64))73 yuanming = Column(VARCHAR(64))74 guoji = Column(VARCHAR(64))75 minzu = Column(VARCHAR(64))76 shengri = Column(VARCHAR(64))77 zuji = Column(VARCHAR(64))78 huji = Column(VARCHAR(64))79 jiaxiang = Column(VARCHAR(64))80 chushengde = Column(VARCHAR(64))81 zujiguxiang = Column(VARCHAR(64))82 zhengzhixinyang = Column(VARCHAR(64))83 shuxiang = Column(VARCHAR(64))84 xingzuo = Column(VARCHAR(64))85 xuexing = Column(VARCHAR(64))86 sanweichicun = Column(VARCHAR(64))87 shengao = Column(VARCHAR(128))88 tizhong = Column(VARCHAR(128))89 jiaochicun = Column(VARCHAR(128))90 xiema = Column(VARCHAR(128))91 xiehao = Column(VARCHAR(128))92 xuewei = Column(VARCHAR(128))93 citiao = Column(VARCHAR(256))94 type = Column(INTEGER(11))95 sourcecategory_id = Column(INTEGER(11))96 chushengriqi = Column(VARCHAR(64))97class Baikearound(Base):98 __tablename__ = 'baikearound'99 id = Column(INTEGER(11), primary_key=True)100 baike_id = Column(INTEGER(11))101 zongjiao = Column(VARCHAR(64))102 zongjiaoxinyang = Column(LONGTEXT)103 xinyangzongjiao = Column(LONGTEXT)104 jingtongyuyan = Column(LONGTEXT)105 suohuiyuyan = Column(LONGTEXT)106 shanchangyuyan = Column(LONGTEXT)107 zhangwowaiyu = Column(LONGTEXT)108 shanchangdeyuyan = Column(LONGTEXT)109 yuyannengli = Column(LONGTEXT)110 zhiye = Column(LONGTEXT)111 qianyuegongsi = Column(LONGTEXT)112 jingjigongsi = Column(LONGTEXT)113 changpiangongsi = Column(LONGTEXT)114 gerenchangpiangongsi = Column(LONGTEXT)115 yinyuezhizuogongsi = Column(LONGTEXT)116 ribenchangpiangongsi = Column(LONGTEXT)117 neidijingji = Column(LONGTEXT)118 danwei = Column(LONGTEXT)119 yanchugongsi = Column(LONGTEXT)120 zhongguodailigongsi = Column(LONGTEXT)121 xuanchuangongsi = Column(LONGTEXT)122 yuandanwei = Column(LONGTEXT)123 xiandanwei = Column(LONGTEXT)124 suoshuchangpiangongsi = Column(LONGTEXT)125 yinyuegongsi = Column(LONGTEXT)126 yingshigongsi = Column(LONGTEXT)127 shishanggongsi = Column(LONGTEXT)128 zhongguojingjigongsi = Column(LONGTEXT)129 motegongsi = Column(LONGTEXT)130 chudaogequ = Column(LONGTEXT)131 chudaozuopin = Column(LONGTEXT)132 chenglishijian = Column(LONGTEXT)133 chudaonianfen = Column(LONGTEXT)134 zhiwu = Column(LONGTEXT)135 gongzuolinian = Column(LONGTEXT)136 jiaoyuchengdu = Column(LONGTEXT)137 biyeyuanxiao = Column(LONGTEXT)138 jiuduyuanxiao = Column(LONGTEXT)139 jiuduxuexiao = Column(LONGTEXT)140 jinxiuyuanxiao = Column(LONGTEXT)141 liuxueyuanxiao = Column(LONGTEXT)142 biyeyuanxi = Column(LONGTEXT)143 liuxuexueyuan = Column(LONGTEXT)144 biyeshijian = Column(LONGTEXT)145 yueqi = Column(LONGTEXT)146 shanchangyundong = Column(LONGTEXT)147 yundongzhuanchang = Column(LONGTEXT)148 gerencaiyi = Column(LONGTEXT)149 shanchangyueqi = Column(LONGTEXT)150 yundongtechang = Column(LONGTEXT)151 yanzouyueqi = Column(LONGTEXT)152 zhuanchang = Column(LONGTEXT)153 shanchang = Column(LONGTEXT)154 yishutechang = Column(LONGTEXT)155 zuishanchangdeyueqi = Column(LONGTEXT)156 zuishuxideyueqi = Column(LONGTEXT)157 yueqizhuanchang = Column(LONGTEXT)158 tebiezhuanchang = Column(LONGTEXT)159 renshenggeyan = Column(LONGTEXT)160 shenghuoxinnian = Column(LONGTEXT)161 gerenlixiang = Column(LONGTEXT)162 gerenmingyan = Column(LONGTEXT)163 zuixihuandeyundong = Column(LONGTEXT)164 xiaiyundong = Column(LONGTEXT)165 gerenaihao = Column(LONGTEXT)166 xingqu = Column(LONGTEXT)167 shihao = Column(LONGTEXT)168 richangaihao = Column(LONGTEXT)169 xingqutechang = Column(LONGTEXT)170 renwuguandian = Column(LONGTEXT)171 caifupaiming = Column(LONGTEXT)172 QQhaoma = Column(LONGTEXT)173 weixinpingtai = Column(LONGTEXT)174 xinlangweiboID = Column(LONGTEXT)175 guanwang = Column(LONGTEXT)176 instagram = Column(LONGTEXT)177 FB = Column(LONGTEXT)178 twitter = Column(LONGTEXT)179 douyin = Column(LONGTEXT)180 yuletuanti = Column(LONGTEXT)181 suoshufenzu = Column(LONGTEXT)182 suoshutuandui = Column(LONGTEXT)183 zongyizuhe = Column(LONGTEXT)184 duineizhiwu = Column(LONGTEXT)185 zhuchang = Column(LONGTEXT)186 jitashou = Column(LONGTEXT)187 jianpanshou = Column(LONGTEXT)188 zuhezhuchang = Column(LONGTEXT)189 zuhelingwu = Column(LONGTEXT)190 duineizhiwei = Column(LONGTEXT)191 duizhongzhiwu = Column(LONGTEXT)192 fensiming = Column(LONGTEXT)193 fensimingzi = Column(LONGTEXT)194 fensinicheng = Column(LONGTEXT)195 fensi = Column(LONGTEXT)196 yingyouhui = Column(LONGTEXT)197 Fansnicheng = Column(LONGTEXT)198 guanfangfensiming = Column(LONGTEXT)199 fensimingci = Column(LONGTEXT)200 gemimingcheng = Column(LONGTEXT)201 fensituan = Column(LONGTEXT)202 quanqiufensihui = Column(LONGTEXT)203 fensizicheng = Column(LONGTEXT)204 fensichengwei = Column(LONGTEXT)205 fensituantimingcheng = Column(LONGTEXT)206 fensizuzhi = Column(LONGTEXT)207 fensituanyingyuanse = Column(LONGTEXT)208 gerenyingyuanse = Column(LONGTEXT)209 yingyuandaibiaose = Column(LONGTEXT)210 guanfangyingyuanse = Column(LONGTEXT)211 daibiaose = Column(LONGTEXT)212 duineidaibiaoyanse = Column(LONGTEXT)213 chenghao = Column(LONGTEXT)214 huodederongyu = Column(LONGTEXT)215 gongyijijin = Column(LONGTEXT)216 gongyi = Column(LONGTEXT)217 gerenjijin = Column(LONGTEXT)218 cishanmujuanshiye = Column(LONGTEXT)219 xiwangxiaoxue = Column(LONGTEXT)220 gongyituanti = Column(LONGTEXT)221 yundongxiangmu = Column(LONGTEXT)222 zhuanyetedian = Column(LONGTEXT)223 bisaishuju = Column(LONGTEXT)224 jiaozhang = Column(LONGTEXT)225 liankaochengji = Column(LONGTEXT)226 liankaopaiming = Column(LONGTEXT)227 shijieyulianIDhao = Column(INTEGER(11))228 buduiguanzhi = Column(LONGTEXT)229 daiyanpinpai = Column(LONGTEXT)230 qushishijian = Column(LONGTEXT)231 gerengongzuoshi = Column(LONGTEXT)232 gerengongzuoshi1 = Column(LONGTEXT)233 gerengongzuoshi2 = Column(LONGTEXT)234 zuixihuandeyiren = Column(LONGTEXT)235 zuixihuandeyanyuan = Column(LONGTEXT)236 xihuandegeshou = Column(LONGTEXT)237 zuixihuandegexing = Column(LONGTEXT)238 xihuandeyanyuan = Column(LONGTEXT)239 zuixihuandegeshou = Column(LONGTEXT)240 xihuandenangeshou = Column(LONGTEXT)241 xiaideyuedui = Column(LONGTEXT)242 xihuandenvyanyuan = Column(LONGTEXT)243 xihuandenanyanyuan = Column(LONGTEXT)244 xihuandeyiren = Column(LONGTEXT)245 chongwu = Column(LONGTEXT)246 xihuanyanse = Column(LONGTEXT)247 xihuandedianying = Column(LONGTEXT)248 zuixihuandeshiwu = Column(LONGTEXT)249 xihuandeshuiguo = Column(LONGTEXT)250 xihuandeshipin = Column(LONGTEXT)251 xihuandelingshi = Column(LONGTEXT)252 zuixihuandedifang = Column(LONGTEXT)253 zuixihuandehua = Column(LONGTEXT)254 xihuandeshuji = Column(LONGTEXT)255 zuixihuandejieri = Column(LONGTEXT)256 zuixihuandemanhua = Column(LONGTEXT)257 taoyandeshiwu = Column(LONGTEXT)258 zuitaoyandeshiwu = Column(LONGTEXT)259 zuitaoyandeyule = Column(LONGTEXT)260 fengge = Column(LONGTEXT)261 leixing = Column(LONGTEXT)262 Style = Column(LONGTEXT)263 yinyueleibie = Column(LONGTEXT)264 qufeng = Column(LONGTEXT)265 gequleixing = Column(LONGTEXT)266 xingge = Column(LONGTEXT)267 mudi = Column(LONGTEXT)268 jiuduzhuanye = Column(LONGTEXT)269 jiankuan = Column(LONGTEXT)270 shengxiao = Column(VARCHAR(64))271 fensikouhao = Column(LONGTEXT)272 zichuangchaoliupinpai = Column(LONGTEXT)273 chuanglipinpai = Column(LONGTEXT)274 jingdianyingmuxingxiang = Column(LONGTEXT)275 wenzhijibie = Column(VARCHAR(64))276 huajuzhicheng = Column(VARCHAR(64))277 kouhao = Column(LONGTEXT)278 guojiazhicheng = Column(LONGTEXT)279 baidutieba = Column(LONGTEXT)280 manyizijidedifang = Column(LONGTEXT)281 nonglishengri = Column(VARCHAR(64))282 chunvzuo = Column(VARCHAR(256))283 zhuanjizongxiaoliang = Column(VARCHAR(64))284 hunlian = Column(LONGTEXT)285 zuikaixindeshi = Column(LONGTEXT)286 zhongfangjingjigongsi = Column(VARCHAR(128))287 xuanchuanqihuagongsi = Column(VARCHAR(128))288 cengshutuanti = Column(VARCHAR(128))289 yuanzuhe = Column(VARCHAR(128))290 xiongdizuhe = Column(VARCHAR(128))291 qianrenchengyuan = Column(VARCHAR(128))292 zuhedandang = Column(VARCHAR(128))293 gerenzhuanshugongsi = Column(VARCHAR(128))294 suozaizuhe = Column(VARCHAR(128))295 jiuzhigongsi = Column(VARCHAR(128))296 suoshuxiaofendui = Column(VARCHAR(128))297 huodongqijian = Column(VARCHAR(128))298 zuhexiaofendui = Column(VARCHAR(128))299 chudaori = Column(VARCHAR(128))300 zuhechudaori = Column(VARCHAR(128))301 chudaoshijian = Column(VARCHAR(128))302 chudaodi = Column(VARCHAR(128))303 chudaoriqi = Column(VARCHAR(128))304 solochudaori = Column(VARCHAR(128))305 zhuanyejineng = Column(VARCHAR(128))306 suoshuyundongdui = Column(VARCHAR(128))307 jibenxinxi = Column(LONGTEXT)308class Baikeproduction(Base):309 __tablename__ = 'baikeproduction'310 id = Column(INTEGER(11), primary_key=True)311 baike_id = Column(INTEGER(11))312 daibiaozuopin = Column(LONGTEXT)313 yinyuedaibiaozuo = Column(LONGTEXT)314 yingshidaibiaozuo = Column(LONGTEXT)315 dianyingdaibiaozuo = Column(LONGTEXT)316 dianshijudaibiaozuo = Column(LONGTEXT)317 daibiaozhuanji = Column(LONGTEXT)318 chengmingzuo = Column(LONGTEXT)319 zhuyaoyinyuezuopin = Column(LONGTEXT)320 zhuanji = Column(LONGTEXT)321 danqu = Column(LONGTEXT)322 daibiaogequ = Column(LONGTEXT)323 gerenzhuanji = Column(LONGTEXT)324 gerendanqu = Column(LONGTEXT)325 yuanchuangqumu = Column(LONGTEXT)326 canyandianshiju = Column(LONGTEXT)327 zongyijiemu = Column(LONGTEXT)328 gerenxiezhen = Column(LONGTEXT)329 zuocizuopin = Column(LONGTEXT)330 canyanMV = Column(LONGTEXT)331 zhuchizuopin = Column(LONGTEXT)332 canyanduanpian = Column(LONGTEXT)333 weitarenchuangzuo = Column(LONGTEXT)334 daoyanchunvzuo = Column(LONGTEXT)335 duanjuweidianying = Column(LONGTEXT)336 touzhiyingshi = Column(LONGTEXT)337 cengzhuchijiemu = Column(LONGTEXT)338 zongyizhuchi = Column(LONGTEXT)339 chubanwu = Column(LONGTEXT)340 daibiaoshujizuopin = Column(LONGTEXT)341 canjiachunwan = Column(LONGTEXT)342 xiaopinzuopin = Column(LONGTEXT)343 canyanwangluoju = Column(LONGTEXT)344 peiyindonghuadianying = Column(LONGTEXT)345 shehuihuodong = Column(LONGTEXT)346 renwupingjia = Column(LONGTEXT)347 renwuzhengyi = Column(LONGTEXT)348 chunvzhizuo = Column(LONGTEXT)349 diyibuzuopin = Column(LONGTEXT)350 jingedaibiaozuo = Column(LONGTEXT)351 zhuyaojiangxiang = Column(LONGTEXT)352 yinyueleixing = Column(LONGTEXT)353 remengequ = Column(LONGTEXT)354 canyandianying = Column(LONGTEXT)355class Baikerelationship(Base):356 __tablename__ = 'baikerelationship'357 id = Column(INTEGER(11), primary_key=True)358 zhangfu = Column(LONGTEXT)359 qizi = Column(LONGTEXT)360 peiou = Column(LONGTEXT)361 erzi = Column(LONGTEXT)362 nver = Column(LONGTEXT)363 jiaren = Column(LONGTEXT)364 jiatingchengyuan = Column(LONGTEXT)365 danver = Column(LONGTEXT)366 xiaonver = Column(LONGTEXT)367 daerzi = Column(LONGTEXT)368 xiaoerzi = Column(LONGTEXT)369 jiazhongpaihang = Column(LONGTEXT)370 muqin = Column(LONGTEXT)371 fuqin = Column(LONGTEXT)372 jiejie = Column(LONGTEXT)373 jiatingzhuangkuang = Column(LONGTEXT)374 zinv = Column(LONGTEXT)375 airen = Column(LONGTEXT)376 zhangnv = Column(LONGTEXT)377 cinv = Column(LONGTEXT)378 jiatingqingkuang = Column(LONGTEXT)379 qinshu = Column(LONGTEXT)380 didi = Column(LONGTEXT)381 gege = Column(LONGTEXT)382 yeye = Column(LONGTEXT)383 mama = Column(LONGTEXT)384 baba = Column(LONGTEXT)385 biaoge = Column(LONGTEXT)386 jiashu = Column(LONGTEXT)387 fujun = Column(LONGTEXT)388 tongmumeimei = Column(LONGTEXT)389 fumu = Column(LONGTEXT)390 xianrenqizi = Column(LONGTEXT)391 nainai = Column(LONGTEXT)392 zhuyaojiatingchengyuan = Column(LONGTEXT)393 zufu = Column(LONGTEXT)394 zumu = Column(LONGTEXT)395 xiongzhang = Column(LONGTEXT)396 jiatinggoucheng = Column(LONGTEXT)397 waizengzufu = Column(LONGTEXT)398 waizufu = Column(LONGTEXT)399 xianqi = Column(LONGTEXT)400 diyirenqizi = Column(LONGTEXT)401 diyirenqianqi = Column(LONGTEXT)402 jingjiren = Column(LONGTEXT)403 tongxue = Column(LONGTEXT)404 xiaoyou = Column(LONGTEXT)405 shicheng = Column(LONGTEXT)406 enshi = Column(LONGTEXT)407 zhidaojiaoshi = Column(LONGTEXT)408 gechanglaoshi = Column(LONGTEXT)409 biaoyanlaoshi = Column(LONGTEXT)410 haopengyou = Column(LONGTEXT)411 quanneihaoyou = Column(LONGTEXT)412 yuetanhaoyou = Column(LONGTEXT)413 qianfu = Column(LONGTEXT)414 qiannanyou = Column(LONGTEXT)415 qiannvyou = Column(LONGTEXT)416 qianqi = Column(LONGTEXT)417 xiannvyou = Column(LONGTEXT)418 xiannanyou = Column(LONGTEXT)419 ganqingjingli = Column(LONGTEXT)420 zhizi = Column(LONGTEXT)421 xiangguantuanti = Column(LONGTEXT)422 cengshuzuhe = Column(LONGTEXT)423 guowangchengyuanqianrenchengyuan = Column(LONGTEXT)424 qianzuhe = Column(LONGTEXT)425 feiwen = Column(LONGTEXT)426 pengyou = Column(LONGTEXT)427 nvyou = Column(LONGTEXT)428 diyiweiqizi = Column(LONGTEXT)429 dierweiqizi = Column(LONGTEXT)430 nanyou = Column(LONGTEXT)431 quanzhonghaoyou = Column(LONGTEXT)432 haiwaijingjigongsi = Column(LONGTEXT)433 dadang = Column(LONGTEXT)434 guanfangduishou = Column(LONGTEXT)435 jiating = Column(LONGTEXT)436 nvpengyou = Column(LONGTEXT)437 tonggongsiyiren = Column(LONGTEXT)438 nanpengyou = Column(LONGTEXT)439 sudi = Column(LONGTEXT)440 dixi = Column(VARCHAR(512))441 gonggong = Column(VARCHAR(128))442 haoyou = Column(VARCHAR(128))443 jimu = Column(VARCHAR(128))444 jiuma = Column(VARCHAR(128))445 laoshi = Column(VARCHAR(128))446 meimei = Column(VARCHAR(128))447 waigong = Column(VARCHAR(128))448 waishengnv = Column(VARCHAR(128))449 xuesheng = Column(VARCHAR(128))450 yima = Column(LONGTEXT)451 yinv = Column(VARCHAR(128))452 yizi = Column(VARCHAR(128))453 yuefu = Column(VARCHAR(128))454 biaodi = Column(LONGTEXT)455 biaogufu = Column(LONGTEXT)456 biaojie = Column(LONGTEXT)457 biaomei = Column(LONGTEXT)458 biaoyi = Column(LONGTEXT)459 bobo = Column(LONGTEXT)460 bole = Column(LONGTEXT)461 chengyuan = Column(LONGTEXT)462 chuanbozhe = Column(LONGTEXT)463 dajiuge = Column(LONGTEXT)464 daoshi = Column(LONGTEXT)465 dayeye = Column(LONGTEXT)466 duishou = Column(LONGTEXT)467 duiyuan = Column(LONGTEXT)468 duizhang = Column(LONGTEXT)469 erxi = Column(LONGTEXT)470 fuqi = Column(LONGTEXT)471 gufu = Column(LONGTEXT)472 guma = Column(LONGTEXT)473 hezuoren = Column(LONGTEXT)474 jiefu = Column(LONGTEXT)475 jifu = Column(LONGTEXT)476 jinv = Column(LONGTEXT)477 jiren = Column(LONGTEXT)478 jiujiu = Column(LONGTEXT)479 jizi = Column(LONGTEXT)480 lianjin = Column(LONGTEXT)481 lingdao = Column(LONGTEXT)482 meifu = Column(LONGTEXT)483 nvxu = Column(LONGTEXT)484 ouxiang = Column(LONGTEXT)485 popo = Column(LONGTEXT)486 qianduiyou = Column(LONGTEXT)487 qidi = Column(LONGTEXT)488 qimei = Column(LONGTEXT)489 qingjiagong = Column(LONGTEXT)490 qingjiamu = Column(LONGTEXT)491 saozi = Column(LONGTEXT)492 shidi = Column(LONGTEXT)493 shifu = Column(LONGTEXT)494 shijie = Column(LONGTEXT)495 shimei = Column(LONGTEXT)496 shisheng = Column(LONGTEXT)497 shixiong = Column(LONGTEXT)498 shiye = Column(LONGTEXT)499 shizu = Column(LONGTEXT)500 shushu = Column(LONGTEXT)501 sunnv = Column(LONGTEXT)502 sunzi = Column(LONGTEXT)503 tangdi = Column(LONGTEXT)504 tangge = Column(LONGTEXT)505 tangjie = Column(LONGTEXT)506 tangmei = Column(LONGTEXT)507 tongmen = Column(LONGTEXT)508 tuandui = Column(LONGTEXT)509 tuanti = Column(LONGTEXT)510 waipo = Column(LONGTEXT)511 waisheng = Column(LONGTEXT)512 waisun = Column(LONGTEXT)513 waisunnv = Column(LONGTEXT)514 waisunzi = Column(LONGTEXT)515 weihunfu = Column(LONGTEXT)516 weihunqi = Column(LONGTEXT)517 xianfu = Column(LONGTEXT)518 xiaoguzi = Column(LONGTEXT)519 xiaoyi = Column(LONGTEXT)520 xiashu = Column(LONGTEXT)521 yangfu = Column(LONGTEXT)522 yangzi = Column(LONGTEXT)523 yifu2 = Column(LONGTEXT)524 yifu4 = Column(LONGTEXT)525 yimu = Column(LONGTEXT)526 yuemu = Column(LONGTEXT)527 zengzufu = Column(LONGTEXT)528 zhanyou = Column(LONGTEXT)529 zhinv = Column(LONGTEXT)530 zhouli = Column(LONGTEXT)531 baike_id = Column(INTEGER(11))532 duiyou = Column(LONGTEXT)533 suoshutuanti = Column(LONGTEXT)534class Ballot(Base):535 __tablename__ = 'ballot'536 id = Column(INTEGER(11), primary_key=True)537 create_time = Column(DATETIME(fsp=6), nullable=False)538 over_time = Column(DATETIME(fsp=6), nullable=False)539 title = Column(VARCHAR(512), nullable=False)540 event_id = Column(INTEGER(11))541class BallotAtitude(Base):542 __tablename__ = 'ballot_atitude'543 id = Column(INTEGER(11), primary_key=True)544 ballot_id = Column(INTEGER(11), nullable=False)545 user_id = Column(INTEGER(11), nullable=False)546 create_time = Column(DATETIME(fsp=6), nullable=False)547class BallotOption(Base):548 __tablename__ = 'ballot_option'549 id = Column(INTEGER(11), primary_key=True)550 ballot_id = Column(INTEGER(11), nullable=False)551 option = Column(VARCHAR(256), nullable=False)552class Behaviorkeyword(Base):553 __tablename__ = 'behaviorkeyword'554 id = Column(INTEGER(11), primary_key=True)555 keywordname = Column(VARCHAR(512))556class BehaviorkeywordManyEvent(Base):557 __tablename__ = 'behaviorkeyword_many_event'558 id = Column(INTEGER(11), primary_key=True)559 behaviorkeyword_id = Column(INTEGER(11))560 event_id = Column(INTEGER(11))561class Cookie(Base):562 __tablename__ = 'cookie'563 id = Column(INTEGER(11), primary_key=True)564 username = Column(String(255))565 password = Column(String(255))566 cookies = Column(Text)567 create_time = Column(DateTime, nullable=False)568class Dataorigin(Base):569 __tablename__ = 'dataorigin'570 id = Column(INTEGER(11), primary_key=True)571 article_id = Column(INTEGER(11))572 dynamic_id = Column(INTEGER(11))573 label_id = Column(INTEGER(11))574 is_create = Column(TINYINT(1), server_default=text("'0'"))575class Datatype(Base):576 __tablename__ = 'datatype'577 id = Column(INTEGER(11), primary_key=True)578 name = Column(String(64))579class DjangoContentType(Base):580 __tablename__ = 'django_content_type'581 __table_args__ = (582 Index('django_content_type_app_label_model_76bd3d3b_uniq', 'app_label', 'model', unique=True),583 )584 id = Column(INTEGER(11), primary_key=True)585 app_label = Column(String(100), nullable=False)586 model = Column(String(100), nullable=False)587class DjangoMigration(Base):588 __tablename__ = 'django_migrations'589 id = Column(INTEGER(11), primary_key=True)590 app = Column(String(255), nullable=False)591 name = Column(String(255), nullable=False)592 applied = Column(DATETIME(fsp=6), nullable=False)593class DjangoSession(Base):594 __tablename__ = 'django_session'595 session_key = Column(String(40), primary_key=True)596 session_data = Column(LONGTEXT, nullable=False)597 expire_date = Column(DATETIME(fsp=6), nullable=False, index=True)598class DoubanChannel(Base):599 __tablename__ = 'douban_channel'600 id = Column(INTEGER(16), primary_key=True, comment='主键')601 baike_entry = Column(String(255), comment='百科词条')602 baike_id = Column(INTEGER(18), comment='百科id')603 baike_birthday = Column(String(255), comment='百科生日')604 baike_type = Column(INTEGER(255), comment='百科类型')605 douban_movie_id = Column(INTEGER(16), comment='豆瓣作品id')606class DoubanStar(Base):607 __tablename__ = 'douban_star'608 id = Column(INTEGER(18), primary_key=True, comment='豆瓣明星表id')609 douban_channel_id = Column(INTEGER(18), comment='渠道表id')610 douban_movie_star_id = Column(INTEGER(18), comment='豆瓣明星id')611 star_name = Column(Text, comment='明星名字')612 gender = Column(String(255), comment='性别')613 constellation = Column(String(255), comment='星座')614 birthday = Column(String(255), comment='生日')615 birthplace = Column(Text, comment='出生地')616 profession = Column(Text, comment='职业')617 family_member = Column(Text, comment='家庭成员')618 imdb = Column(Text, comment='imdb编号')619 official_site = Column(Text, comment='官方网站')620 more_china_name = Column(Text, comment='更多中文名')621 more_english_name = Column(Text, comment='更多外文名')622 star_intro = Column(Text, comment='明星简介')623 star_fans_num = Column(String(255), comment='影迷数')624 star_head_image = Column(Text, comment='头像')625class DoubanStarWork(Base):626 __tablename__ = 'douban_star_works'627 id = Column(INTEGER(18), primary_key=True, comment='主键')628 douban_star_id = Column(INTEGER(18), comment='豆瓣明星id')629 douban_works_id = Column(INTEGER(18), comment='豆瓣作品id')630 works_post = Column(String(255), comment='作品职位')631 works_role = Column(Text, comment='扮演角色')632 star_name = Column(String(255), comment='职员名字')633 works_name = Column(Text, comment='作品名字')634class DoubanWork(Base):635 __tablename__ = 'douban_works'636 id = Column(INTEGER(18), primary_key=True, comment='主键id')637 douban_works_id = Column(INTEGER(18), comment='豆瓣作品id')638 douban_works_name = Column(Text, comment='豆瓣作品名')639 head_image_url = Column(Text, comment='豆瓣作品海报')640 old_name = Column(Text, comment='原名')641 alternate_name = Column(Text, comment='又名')642 director = Column(Text, comment='导演')643 writer = Column(Text, comment='编剧')644 act = Column(Text, comment='主演')645 works_type = Column(Text, comment='类型')646 flaking_acre = Column(Text, comment='制片国家地区')647 year_time = Column(Text, comment='年代')648 language = Column(Text, comment='语言')649 show_time = Column(Text, comment='上映时间')650 mins = Column(String(255), comment='片长')651 imdb = Column(String(255), comment='IMDb链接')652 official_site = Column(String(255), comment='官方网站')653 douban_way = Column(String(255), comment='豆瓣小站')654 debut = Column(String(255), comment='首播')655 TV_number = Column(String(255), comment='集数')656 one_mins = Column(String(255), comment='单集片长')657 grade = Column(String(255), comment='评分')658 grade_number = Column(String(255), comment='评分人数')659 works_intor = Column(LONGTEXT, comment='作品简介')660 often_label = Column(Text, comment='常用标签')661 short_evaluate_num = Column(String(255), comment='短评数')662class Dynamic(Base):663 __tablename__ = 'dynamic'664 id = Column(INTEGER(11), primary_key=True)665 release_time = Column(DATETIME(fsp=6))666 release_state = Column(INTEGER(11))667 read_amount = Column(INTEGER(11))668 description = Column(String(128))669 correct_state = Column(INTEGER(11))670 data = Column(LONGTEXT)671 share_image_url = Column(String(32))672 create_time = Column(DATETIME(fsp=6))673 label_id = Column(INTEGER(11))674 dynamicsource = Column(String(128), nullable=False)675 dynamicsource_id = Column(INTEGER(11))676 url = Column(String(256))677 updata_data = Column(LONGTEXT)678 source_id = Column(String(128))679class DynamicManySource(Base):680 __tablename__ = 'dynamic_many_source'681 id = Column(INTEGER(11), primary_key=True)682 source_id = Column(INTEGER(11))683 Dynamic_id = Column(INTEGER(11))684class Dynamicsource(Base):685 __tablename__ = 'dynamicsource'686 id = Column(INTEGER(11), primary_key=True)687 name = Column(LONGTEXT)688 weibo_ID = Column(String(100))689class Event(Base):690 __tablename__ = 'event'691 id = Column(INTEGER(11), primary_key=True)692 event_title = Column(String(32))693 event_lable = Column(INTEGER(11))694 event_introduction = Column(LONGTEXT)695 create_time = Column(DATETIME(fsp=6), nullable=False)696 is_updata = Column(TINYINT(1), nullable=False)697 event_picture_url = Column(String(256))698 dataytpe_id = Column(INTEGER(11), nullable=False)699 likeamount = Column(INTEGER(11), nullable=False)700 unlikeamount = Column(INTEGER(11), nullable=False)701 is_show = Column(TINYINT(1), nullable=False)702 update_time = Column(DATETIME(fsp=6), nullable=False)703class EventGatherManyEvent(Base):704 __tablename__ = 'eventGather_many_event'705 id = Column(INTEGER(11), primary_key=True)706 eventGather_id = Column(INTEGER(11), nullable=False)707 event_id = Column(INTEGER(11), nullable=False)708class EventManySource(Base):709 __tablename__ = 'event_many_source'710 id = Column(INTEGER(11), primary_key=True)711 source_id = Column(INTEGER(11))712 Event_id = Column(INTEGER(11))713class Eventgather(Base):714 __tablename__ = 'eventgather'715 id = Column(INTEGER(11), primary_key=True)716 is_updata = Column(TINYINT(1), nullable=False)717 creat_time = Column(DATETIME(fsp=6), nullable=False)718 label_id = Column(INTEGER(11))719 introduction = Column(LONGTEXT)720 name = Column(String(128))721 picture1 = Column(String(128))722 picture2 = Column(String(128))723 state = Column(INTEGER(11), nullable=False)724 type = Column(INTEGER(11), nullable=False)725 update_time = Column(DATETIME(fsp=6), nullable=False)726 dataytpe_id = Column(INTEGER(11), nullable=False)727class Focu(Base):728 __tablename__ = 'focus'729 id = Column(INTEGER(11), primary_key=True)730 content = Column(String(128), nullable=False)731 title = Column(String(128), nullable=False)732 event_id = Column(INTEGER(11), nullable=False)733 create_time = Column(DATETIME(fsp=6), nullable=False)734class Interestingcomment(Base):735 __tablename__ = 'interestingcomment'736 id = Column(INTEGER(11), primary_key=True)737 is_show = Column(TINYINT(1), nullable=False)738 comment_id = Column(INTEGER(11), nullable=False)739 event_id = Column(INTEGER(11), nullable=False)740 label = Column(INTEGER(11))741class Keyword(Base):742 __tablename__ = 'keyword'743 id = Column(INTEGER(11), primary_key=True)744 keyword_name = Column(String(64), nullable=False)745 create_time = Column(DATETIME(fsp=6), nullable=False)746class Label(Base):747 __tablename__ = 'label'748 id = Column(INTEGER(11), primary_key=True)749 create_time = Column(DATETIME(fsp=6), nullable=False)750class Labelclas(Base):751 __tablename__ = 'labelclass'752 id = Column(INTEGER(11), primary_key=True)753 create_time = Column(DATETIME(fsp=6), nullable=False)754class Media(Base):755 __tablename__ = 'media'756 id = Column(INTEGER(11), primary_key=True)757 is_picture = Column(TINYINT(1), nullable=False)758 url = Column(String(256))759 hash = Column(String(256))760 create_time = Column(DATETIME(fsp=6))761class MediaManyDyanmic(Base):762 __tablename__ = 'media_many_dyanmic'763 id = Column(INTEGER(11), primary_key=True)764 media_id = Column(INTEGER(11))765 dynamic_id = Column(INTEGER(11))766class Module(Base):767 __tablename__ = 'module'768 id = Column(INTEGER(11), primary_key=True)769 module_name = Column(String(256))770class Multimediamesource(Base):771 __tablename__ = 'multimediamesource'772 id = Column(INTEGER(11), primary_key=True)773 picture_id = Column(INTEGER(11))774 video_id = Column(INTEGER(11))775 media_id = Column(INTEGER(11))776 creat_time = Column(String(32), nullable=False)777class Onebox(Base):778 __tablename__ = 'onebox'779 id = Column(INTEGER(11), primary_key=True)780 event_id = Column(INTEGER(11), nullable=False)781 label = Column(INTEGER(11))782 onebox_name1 = Column(String(256))783 onebox_name2 = Column(String(256))784class OneboxMamyDataorigin(Base):785 __tablename__ = 'onebox_mamy_dataorigin'786 id = Column(INTEGER(11), primary_key=True)787 onebox_id = Column(INTEGER(11), nullable=False)788 dataprigin_id = Column(INTEGER(11), nullable=False)789class Oneboxblack(Base):790 __tablename__ = 'oneboxblack'791 id = Column(INTEGER(11), primary_key=True)792 content = Column(LONGTEXT)793class Oneboxwhite(Base):794 __tablename__ = 'oneboxwhite'795 id = Column(INTEGER(11), primary_key=True)796 content = Column(LONGTEXT)797class Picture(Base):798 __tablename__ = 'pictures'799 id = Column(INTEGER(11), primary_key=True)800 event_id = Column(INTEGER(11), nullable=False)801 name = Column(String(64))802class Productiondevelopment(Base):803 __tablename__ = 'productiondevelopment'804 id = Column(INTEGER(11), primary_key=True)805 baike_id = Column(INTEGER(11), nullable=False)806 type = Column(String(64), nullable=False)807 url = Column(String(256), nullable=False)808 baikeID = Column(INTEGER(11), nullable=False)809 zhuanjimingcheng = Column(String(128), nullable=False)810 danqugequmingcheng = Column(String(128), nullable=False)811 dianshijumingcheng = Column(String(128), nullable=False)812 dianshijushiyanjiaose = Column(String(128), nullable=False)813 dianyingmingcheng = Column(String(128), nullable=False)814 dianyingshiyanjiaose = Column(String(128), nullable=False)815 yanchanghuimingcheng = Column(String(128), nullable=False)816 yanchanghuijubanshijian = Column(String(128), nullable=False)817 zongyijiemushijian = Column(String(128), nullable=False)818 zongyijiemubochushijian = Column(String(128), nullable=False)819 zazhixiezhen = Column(String(128), nullable=False)820 zuocigequmingcheng = Column(String(128), nullable=False)821 canyanMVgequmingcheng = Column(String(128), nullable=False)822 zhuchijiemumingcheng = Column(String(128), nullable=False)823 canyanduanpianmingcheng = Column(String(128), nullable=False)824 weitarenzuoqumingcheng = Column(String(128), nullable=False)825 daoyanzuopinmingcheng = Column(String(128), nullable=False)826 duanjuweidianyingmingcheng = Column(String(128), nullable=False)827 touzhiyingshimingcheng = Column(String(128), nullable=False)828 zhuchiyiingshimingcheng = Column(String(128), nullable=False)829 chubanshujishuming = Column(String(128), nullable=False)830 canjiachunwanjiemumingcheng = Column(String(128), nullable=False)831 canjiachunwanjiemushijian = Column(String(128), nullable=False)832 canyanwangjumingcheng = Column(String(128), nullable=False)833 peiyindonghuamingcheng = Column(String(128), nullable=False)834class Role(Base):835 __tablename__ = 'role'836 id = Column(INTEGER(11), primary_key=True)837 name = Column(String(32), nullable=False)838 description = Column(String(32), nullable=False)839class Source(Base):840 __tablename__ = 'source'841 id = Column(INTEGER(11), primary_key=True)842 source_name = Column(LONGTEXT)843class Sourcemodule(Base):844 __tablename__ = 'sourcemodule'845 id = Column(INTEGER(11), primary_key=True)846 dynamiccsource_id = Column(INTEGER(11))847 module_id = Column(INTEGER(11))848class Sourcenickname(Base):849 __tablename__ = 'sourcenickname'850 id = Column(INTEGER(11), primary_key=True)851 nickname = Column(String(256))852 source_id = Column(INTEGER(11))853class Special(Base):854 __tablename__ = 'special'855 id = Column(INTEGER(11), primary_key=True)856 label_id = Column(INTEGER(11))857 index = Column(INTEGER(11))858 name = Column(String(128))859 introduction = Column(LONGTEXT)860 picture1 = Column(String(128))861 picture2 = Column(String(128))862 state = Column(INTEGER(11), nullable=False)863 type = Column(INTEGER(11), nullable=False)864 creat_time = Column(DATETIME(fsp=6))865 update_time = Column(DATETIME(fsp=6), nullable=False)866 dataytpe_id = Column(INTEGER(11), nullable=False)867class SpecialManyEvent(Base):868 __tablename__ = 'special_many_event'869 id = Column(INTEGER(11), primary_key=True)870 special_id = Column(INTEGER(11), nullable=False)871 event_id = Column(INTEGER(11), nullable=False)872class Timeline(Base):873 __tablename__ = 'timeline'874 id = Column(INTEGER(11), primary_key=True)875 title = Column(LONGTEXT, nullable=False)876 preface = Column(LONGTEXT)877 epilogue = Column(LONGTEXT)878 label_id = Column(INTEGER(11))879 event_id = Column(INTEGER(11))880 is_active = Column(TINYINT(1), nullable=False)881 create_time = Column(DATETIME(fsp=6), nullable=False)882class TimelineMamyDataorigin(Base):883 __tablename__ = 'timeline_mamy_dataorigin'884 id = Column(INTEGER(11), primary_key=True)885 timeline_id = Column(INTEGER(11), nullable=False)886 dataorigin_id = Column(INTEGER(11), nullable=False)887class Topic(Base):888 __tablename__ = 'topic'889 id = Column(INTEGER(11), primary_key=True)890 topic_name_cn = Column(String(64), nullable=False)891 topic_name_en = Column(String(64), nullable=False)892 create_time = Column(DATETIME(fsp=6), nullable=False)893 release_state = Column(INTEGER(11), nullable=False)894 avater_url = Column(String(128), nullable=False)895 background_url = Column(String(128), nullable=False)896 topic_explain = Column(String(128), nullable=False)897class User(Base):898 __tablename__ = 'user'899 id = Column(INTEGER(11), primary_key=True)900 mobile = Column(INTEGER(11), nullable=False)901 email = Column(String(32), nullable=False)902 nick_name = Column(String(32), nullable=False)903 avatar_url = Column(String(256), nullable=False)904 open_id = Column(String(256), nullable=False)905 gender = Column(INTEGER(11), nullable=False)906 country = Column(String(32), nullable=False)907 province = Column(String(32), nullable=False)908 city = Column(String(32), nullable=False)909 create_time = Column(DATETIME(fsp=6), nullable=False)910class Userfloweevent(Base):911 __tablename__ = 'userfloweevent'912 id = Column(INTEGER(11), primary_key=True)913 user_id = Column(INTEGER(11), nullable=False)914 is_push = Column(TINYINT(1))915 event_id = Column(INTEGER(11), nullable=False)916 followe_time = Column(String(32), nullable=False)917 last_time = Column(String(32), nullable=False)918class Userflowespecial(Base):919 __tablename__ = 'userflowespecial'920 id = Column(INTEGER(11), primary_key=True)921 user_id = Column(INTEGER(11), nullable=False)922 is_push = Column(TINYINT(1))923 special_id = Column(INTEGER(11), nullable=False)924 followe_time = Column(String(32), nullable=False)925 last_time = Column(String(32), nullable=False)926class Userflowestar(Base):927 __tablename__ = 'userflowestar'928 id = Column(INTEGER(11), primary_key=True)929 user_id = Column(INTEGER(11), nullable=False)930 is_push = Column(TINYINT(1))931 followe_time = Column(String(32), nullable=False)932 last_time = Column(String(32), nullable=False)933 source_id = Column(INTEGER(11))934class Video(Base):935 __tablename__ = 'videos'936 id = Column(INTEGER(11), primary_key=True)937 event_id = Column(INTEGER(11), nullable=False)938class Viewpoint(Base):939 __tablename__ = 'viewpoint'940 id = Column(INTEGER(11), primary_key=True)941 stand_point = Column(String(128), nullable=False)942 focus_id = Column(INTEGER(11), nullable=False)943class ViewpointManyDataorigin(Base):944 __tablename__ = 'viewpoint_many_dataorigin'945 id = Column(INTEGER(11), primary_key=True)946 dataorigin_id = Column(INTEGER(11), nullable=False)947 viewpoint = Column(INTEGER(11), nullable=False)948class AuthPermission(Base):949 __tablename__ = 'auth_permission'950 __table_args__ = (951 Index('auth_permission_content_type_id_codename_01ab375a_uniq', 'content_type_id', 'codename', unique=True),952 )953 id = Column(INTEGER(11), primary_key=True)954 name = Column(String(255), nullable=False)955 content_type_id = Column(INTEGER(11), nullable=False)956 codename = Column(String(100), nullable=False)957class AuthUserGroup(Base):958 __tablename__ = 'auth_user_groups'959 __table_args__ = (960 Index('auth_user_groups_user_id_group_id_94350c0c_uniq', 'user_id', 'group_id', unique=True),961 )962 id = Column(INTEGER(11), primary_key=True)963 user_id = Column(INTEGER(11), nullable=False)964 group_id = Column(INTEGER(11), nullable=False, index=True)965class DjangoAdminLog(Base):966 __tablename__ = 'django_admin_log'967 id = Column(INTEGER(11), primary_key=True)968 action_time = Column(DATETIME(fsp=6), nullable=False)969 object_id = Column(LONGTEXT)970 object_repr = Column(String(200), nullable=False)971 action_flag = Column(SMALLINT(5), nullable=False)972 change_message = Column(LONGTEXT, nullable=False)973 content_type_id = Column(INTEGER(11), index=True)974 user_id = Column(INTEGER(11), nullable=False, index=True)975class AuthGroupPermission(Base):976 __tablename__ = 'auth_group_permissions'977 __table_args__ = (978 Index('auth_group_permissions_group_id_permission_id_0cd325b0_uniq', 'group_id', 'permission_id', unique=True),979 )980 id = Column(INTEGER(11), primary_key=True)981 group_id = Column(INTEGER(11), nullable=False)982 permission_id = Column(INTEGER(11), nullable=False, index=True)983class AuthUserUserPermission(Base):984 __tablename__ = 'auth_user_user_permissions'985 __table_args__ = (986 Index('auth_user_user_permissions_user_id_permission_id_14a6b632_uniq', 'user_id', 'permission_id', unique=True),987 )988 id = Column(INTEGER(11), primary_key=True)989 user_id = Column(INTEGER(11), nullable=False)...

Full Screen

Full Screen

application.py

Source:application.py Github

copy

Full Screen

1#!flask/bin/python2# -*- coding: utf8 -*-3# encoding=utf8 4from flask import Flask5import re6import os7import sys8import json9import time10from datetime import datetime11from pymongo import MongoClient12import pymongo13import requests14from flask import Flask, request, render_template, jsonify15reload(sys) 16sys.setdefaultencoding('utf8')17application = Flask(__name__)18# mongolab_uri = "mongodb://localhost:27017/test"19# client = MongoClient(mongolab_uri,20# connectTimeoutMS=10000,21# socketTimeoutMS=None)22mongolab_uri = "mongodb://heroku_nzqplc8l:kbbpgnt5nnevh8elegapko78v9@ds231961.mlab.com:31961/heroku_nzqplc8l" #os.environ["MONGODB_URI"]23client = MongoClient(mongolab_uri,24 connectTimeoutMS=10000,25 socketTimeoutMS=None,26 socketKeepAlive=True)27db = client.get_default_database()28@application.route("/", methods=["GET"])29def index():30 return "Hello, World!"31@application.route("/api/custom", methods=["POST"])32def addcustomefiled():33 data = request.get_json()34 messenger_id = data["messenger_id"]35 del data["messenger_id"]36 dt = db.user_messenger.update({"messenger_id":messenger_id},{"$set":data})37 return "sucess",20038@application.route("/api/handlemessage", methods=["POST"])39def handle_message():40 data = request.get_json()41 longtext = data["text"]42 messenger_id= data["messenger_id"]43 detectPhone(messenger_id,longtext)44 detectCode(messenger_id,longtext)45 detectUSD(messenger_id,longtext)46 detectDiscount(messenger_id,longtext)47 detectQuestion(messenger_id,longtext)48 detectColor(messenger_id,longtext)49 detectSize(messenger_id,longtext)50 return "sucess", 20051def detectPhone(messenger_id, longtext):52 companyNumber = ["0977484889", "023 999 899", "012223344", "023 6 868 868"]53 pattern = re.compile(54 r"0[0-9]{8,10}|0\d{2}\-\d{3}\-\d{3}\-\d{1}|0\d{2}\-\d{3}\-\d{3}|855\d{8,9}", re.IGNORECASE)55 match = pattern.findall(str(longtext))56 print(match)57 for l in match:58 if l in companyNumber:59 match.remove(l)60 print("final match again ---")61 print(match)62 if len(match) > 0:63 dt = {64 "date": str(time.time()),65 "phone": match66 }67 # db.messenger_report.insert(dt)68 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "phone": dt } })69# detectPhone("023 999 899 070757390 .wing 0977484889 071-333-372-8 truemoney 070-757-390 85512521010 emoney 855977484889 85570757390 271-333-372-8")70def detectCode(messenger_id,longtext):71 pattern = re.compile(r"\d{8}", re.IGNORECASE)72 match = pattern.findall(str(longtext))73 print(match)74 for l in match[:]:75 if l[:1] == "0":76 match.remove(l)77 print(match)78 if len(match) > 0:79 dt = {80 "date": str(time.time()),81 "code": match82 }83 # db.messenger_report.insert(dt)84 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "code": dt } })85# detectCode("99889900 01234567 012345678 0989899 81234567")86def detectUSD(messenger_id,longtext):87 pattern = re.compile(r"USD\s\d+\.\d+", re.IGNORECASE)88 match = pattern.findall(str(longtext))89 print(match)90 if len(match) > 0:91 dt = {92 "function": "detectUSD",93 "amounts": match94 }95 # db.messenger_report.insert(dt)96 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "amounts": dt } })97def detectDiscount(messenger_id,longtext):98 data = {99 "text": longtext,100 "date": datetime.now()101 }102 if("discount" in longtext):103 data["_id"] = str(time.time())104 # db.messenger_report.insert(data)105 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "discount": data } })106 if("ចុះបាន" in longtext):107 data["_id"] = str(time.time())108 # db.messenger_report.insert(data)109 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "discount": data } })110 if("ចុះខ្លះអត់" in longtext):111 data["_id"] = str(time.time())112 # db.messenger_report.insert(data)113 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "discount": data } })114 if("ចុះ" in longtext):115 data["_id"] = str(time.time())116 # db.messenger_report.insert(data)117 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "discount": data } })118def detectQuestion(messenger_id,longtext):119 dt = {120 "_id":str(time.time()),121 "text": longtext,122 "date": datetime.now()123 }124 if("ប៉ុន្មាន" in longtext):125 # db.messenger_report.insert(dt)126 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "questions": dt } })127 if("មានឬអត់" in longtext):128 # db.messenger_report.insert(dt)129 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "questions": longtext } })130 if("អ្វីខ្លះ" in longtext):131 # db.messenger_report.insert(dt)132 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "questions": longtext } })133 if("ដែរឬទេ" in longtext):134 # db.messenger_report.insert(dt)135 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "questions": longtext } })136def detectColor(messenger_id,longtext):137 data = {138 "text": longtext,139 "date": datetime.now()140 }141 if("color" in longtext):142 # db.messenger_report.insert(data)143 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "color": data } })144 if("ពណ៏" in longtext):145 # db.messenger_report.insert(data)146 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "color": data } })147 if("ព័ណ" in longtext):148 # db.messenger_report.insert(data)149 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "color": data } })150def detectSize(messenger_id,longtext):151 data = {152 "function": "detectSize",153 "text": longtext,154 "date": datetime.now()155 }156 if("size" in longtext):157 # db.messenger_report.insert(data)158 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "size": longtext } })159 if("ទំហំ" in longtext):160 # db.messenger_report.insert(data)161 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "size": longtext } })162 if("លេខ" in longtext):163 # db.messenger_report.insert(data)164 db.users_messenger.update({ "messenger_id": messenger_id },{ "$push": { "size": longtext } })165if __name__ == "__main__":...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful