Model and test updates for last_job and last_job_host_summary fields on Host.

This commit is contained in:
Chris Church
2013-05-11 02:10:17 -04:00
parent 8f2ea04b48
commit 6e6600b822
3 changed files with 38 additions and 0 deletions

View File

@@ -220,6 +220,10 @@ class HostSerializer(BaseSerializer):
inventory = reverse('main:inventory_detail', args=(obj.inventory.pk,)),
job_events = reverse('main:host_job_event_list', args=(obj.pk,)),
))
if obj.last_job:
res['last_job'] = reverse('main:job_detail', args=(obj.last_job.pk,))
#if obj.last_job_host_summary:
# res['last_job_host_summary'] = reverse('main:job_host_summary_detail', args=(obj.last_job_host_summary.pk,))
# NICE TO HAVE: possible reverse resource to show what groups the host is in
return res