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 <morgan.fainberg@gmail.com>
Closes-Bug: #1752301
This commit is contained in:
Gage Hugo 2018-02-27 19:55:22 +00:00
parent a419d9b2d0
commit 94ef945885
1 changed files with 1 additions and 6 deletions

View File

@ -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):