From b98748cbfdbcc8918dfb5cbcc0a4d35a99906fdf Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Tue, 27 Feb 2018 19:55:22 +0000 Subject: [PATCH] Remove @expression from tags This change makes tags a property of Project instead of a hybrid_property since we will always have a Project contain some list of tags. Change-Id: I1033321132cb3ec71bf94b8293cef91dfc6b8272 Co-Authored-By: Morgan Fainberg Closes-Bug: #1752301 --- keystone/resource/backends/sql.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/keystone/resource/backends/sql.py b/keystone/resource/backends/sql.py index 65d01ac236..71f06adfc7 100644 --- a/keystone/resource/backends/sql.py +++ b/keystone/resource/backends/sql.py @@ -12,7 +12,6 @@ from oslo_log import log from six import text_type -from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy import orm from keystone.common import driver_hints @@ -316,7 +315,7 @@ class Project(sql.ModelBase, sql.ModelDictMixinWithExtras): # rather than just only 'name' being unique __table_args__ = (sql.UniqueConstraint('domain_id', 'name'),) - @hybrid_property + @property def tags(self): if self._tags: return [tag.name for tag in self._tags] @@ -332,10 +331,6 @@ class Project(sql.ModelBase, sql.ModelDictMixinWithExtras): new_tags.append(tag_ref) self._tags = new_tags - @tags.expression - def tags(cls): - return ProjectTag.name - class ProjectTag(sql.ModelBase, sql.ModelDictMixin):