Added goal+strategy ObjectField for AuditTemplate

In this changeset, I added the "goal" and the "strategy "ObjectField
which can either be loaded by setting the new "eager" parameter as True
or not loaded (as before) by setting it to False.
The advantage of introducing this eager parameter is that this way,
we can reduce to a minimum the overhead of DB queries whenever the
related goal is not actually needed.

Change-Id: I97418163f68aea2f1cda80be94e4035f0b3700ae
Partially-Implements: blueprint watcher-versioned-objects
This commit is contained in:
Vincent Françoise
2016-10-03 12:01:51 +02:00
parent f54aca70cc
commit 54cf10b41c
9 changed files with 234 additions and 147 deletions

View File

@@ -27,6 +27,7 @@ from watcher.tests.objects import utils as obj_utils
class TestAuditEndpoint(base.DbTestCase):
def setUp(self):
super(TestAuditEndpoint, self).setUp()
self.goal = obj_utils.create_test_goal(self.context)
self.audit_template = obj_utils.create_test_audit_template(
self.context)
self.audit = obj_utils.create_test_audit(