Guest User

Untitled

a guest
Apr 4th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #pip install peewee
  2. from peewee import *
  3.  
  4. db = MySQLDatabase('simplex', password='simplex',
  5. user='root',
  6. host='127.0.0.1',
  7. port=3306)
  8.  
  9. class MonitoringLinks(Model):
  10. id = PrimaryKeyField()
  11. url = TextField()
  12. active = BooleanField()
  13.  
  14. class Meta:
  15. database = db
  16. table_name = 'monitoring_links'
  17.  
  18.  
  19. for r in MonitoringLinks.select().where(MonitoringLinks.url.contains('.com.br')) :
  20. print(r.id, r.url, r.active)
Add Comment
Please, Sign In to add comment