Created
March 27, 2018 12:57
-
-
Save jhonata-menezes/2055aae5ea338a318144d61872edf3cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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