2016-09-20 17:35:15 +01:00
|
|
|
from app import db
|
2017-11-28 10:35:16 +00:00
|
|
|
from app.models import ServiceWhitelist
|
2016-09-20 17:35:15 +01:00
|
|
|
|
2016-09-22 17:17:34 +01:00
|
|
|
|
2016-09-20 17:35:15 +01:00
|
|
|
def dao_fetch_service_whitelist(service_id):
|
2016-09-27 13:45:36 +01:00
|
|
|
return ServiceWhitelist.query.filter(
|
|
|
|
|
ServiceWhitelist.service_id == service_id).all()
|
2016-09-22 17:17:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def dao_add_and_commit_whitelisted_contacts(objs):
|
|
|
|
|
db.session.add_all(objs)
|
|
|
|
|
db.session.commit()
|
2016-09-20 17:35:15 +01:00
|
|
|
|
|
|
|
|
|
2016-09-22 17:17:34 +01:00
|
|
|
def dao_remove_service_whitelist(service_id):
|
2016-09-27 13:45:36 +01:00
|
|
|
return ServiceWhitelist.query.filter(
|
|
|
|
|
ServiceWhitelist.service_id == service_id).delete()
|