add facts recent endpoints

* Hang most recent listing of facts per-host off of /hosts/n/
This commit is contained in:
Chris Meyers
2017-04-04 17:09:07 -04:00
parent f5d7d0bce5
commit f7fb541fe2
6 changed files with 20 additions and 2 deletions

View File

@@ -4,12 +4,11 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from jsonbfield.fields import JSONField
from awx.main.fields import JSONBField
__all__ = ('Fact', 'FactRecent')
class FactRecent(models.Model):
host = models.ForeignKey(
'Host',
@@ -97,3 +96,4 @@ class Fact(models.Model):
fact_obj = Fact.objects.create(host_id=host_id, module=module, timestamp=timestamp, facts=facts)
fact_obj.save()
return fact_obj