Commit 75433eed authored by Tomas Taraba's avatar Tomas Taraba

3386 Add relationship to userlabels (labels) table using built-in methods

parent ec481c60
......@@ -17,16 +17,16 @@
from __future__ import unicode_literals
import uuid
import re
import uuid
from sqlalchemy.schema import Column, ForeignKey, PrimaryKeyConstraint, Index, \
UniqueConstraint, ForeignKeyConstraint
from sqlalchemy.types import Integer, String, Text, Boolean
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import relationship, column_property
from sqlalchemy.orm.properties import ColumnProperty
from sqlalchemy.schema import Column, ForeignKey, PrimaryKeyConstraint, Index, \
UniqueConstraint, ForeignKeyConstraint
from sqlalchemy.sql import func, cast, not_
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.types import Integer, String, Text, Boolean
from xivo_dao.alchemy import enum
from xivo_dao.alchemy.cti_profile import CtiProfile
......@@ -142,8 +142,7 @@ class UserFeatures(Base):
UserLine.main_line == True)""")
voicemail = relationship("Voicemail")
cti_profile = relationship("CtiProfile")
labels = relationship("UserLabels",
primaryjoin="""UserFeatures.id == UserLabels.user_id""")
labels = relationship("Labels", secondary="userlabels", back_populates="user_features")
def extrapolate_caller_id(self, extension=None):
default_num = extension.exten if extension else None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment