(department_id, job_title, is_sworn_officer, order)
Add a rank to a department.
Add a rank to a department.
Add a rank to a department .
def add_job_title(department_id, job_title, is_sworn_officer, order):
    """Add a rank to a department."""
    department = Department.query.filter_by(id=department_id).one_or_none()
    is_sworn = (is_sworn_officer == "true")
    job = Job(job_title=job_title, is_sworn_officer=is_sworn, order=order, department=department)
    db.session.add(job)
    print('Added {} to {}'.format(job.job_title, department.name))
    db.session.commit()
def add_job_title ( department_id , job_title , is_sworn_officer , order ) : department = Department . query . filter_by ( id = department_id ) . one_or_none ( ) is_sworn = ( is_sworn_officer == "true" ) job = Job ( job_title = job_title , is_sworn_officer = is_sworn , order = order , department = department ) db . session . add ( job ) print ( 'Added {} to {}' . format ( job . job_title , department . name ) ) db . session . commit ( )