Skip to content

Instantly share code, notes, and snippets.

@jhonata-menezes
Created March 27, 2018 12:57
Show Gist options
  • Save jhonata-menezes/2055aae5ea338a318144d61872edf3cc to your computer and use it in GitHub Desktop.
Save jhonata-menezes/2055aae5ea338a318144d61872edf3cc to your computer and use it in GitHub Desktop.
#pip install peewee
from peewee import *
db = MySQLDatabase('simplex', password='simplex',
user='root',
host='127.0.0.1',
port=3306)
class MonitoringLinks(Model):
id = PrimaryKeyField()
url = TextField()
active = BooleanField()
class Meta:
database = db
table_name = 'monitoring_links'
for r in MonitoringLinks.select().where(MonitoringLinks.url.contains('.com.br')) :
print(r.id, r.url, r.active)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment