Replace SQL with Django ORM.

Change-Id: Ib4ecf4f8b6f203e8ceb98c9f812f7dab7a43bc0e
Search for job by jobid.

Change-Id: Id4e10aa2d6dc5669eb07342acec2b0838479c04f