Add goal name as filter for strategy list cmd

This changeset add the possibility to use the goal name as a
stragegy list filter.

Change-Id: Ibaf45e694f115308f19e9bcd3023fe2e6d1750cd
This commit is contained in:
David TARDIVEL
2016-05-27 11:20:55 +02:00
parent 8c6bf734af
commit 6eee64502f
3 changed files with 56 additions and 8 deletions

View File

@@ -281,7 +281,10 @@ class Connection(api.BaseConnection):
def _add_strategies_filters(self, query, filters):
plain_fields = ['uuid', 'name', 'display_name', 'goal_id']
join_fieldmap = {'goal_uuid': ("uuid", models.Goal)}
join_fieldmap = {
'goal_uuid': ("uuid", models.Goal),
'goal_name': ("name", models.Goal)
}
return self._add_filters(
query=query, model=models.Strategy, filters=filters,