mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Added model and dao for Jobs.
This commit is contained in:
19
app/dao/jobs_dao.py
Normal file
19
app/dao/jobs_dao.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from app import db
|
||||
from app.models import Job
|
||||
|
||||
|
||||
def save_job(job):
|
||||
db.session.add(job)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def get_job_by_id(id):
|
||||
return Job.query.get(id)
|
||||
|
||||
|
||||
def get_jobs_by_service(service_id):
|
||||
return Job.query.filter_by(service_id=service_id).all()
|
||||
|
||||
|
||||
def get_jobs():
|
||||
return Job.query.all()
|
||||
Reference in New Issue
Block a user