Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
X
xivo-dao
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xivo.solutions
xivo-dao
Commits
c083ab21
Commit
c083ab21
authored
Jun 23, 2020
by
Laurent Meiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3386 WIP still issue with tests...
parent
7f878d45
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
9 deletions
+13
-9
xivo_dao/alchemy/__init__.py
xivo_dao/alchemy/__init__.py
+1
-0
xivo_dao/alchemy/all/__init__.py
xivo_dao/alchemy/all/__init__.py
+2
-0
xivo_dao/alchemy/labels.py
xivo_dao/alchemy/labels.py
+1
-1
xivo_dao/alchemy/userfeatures.py
xivo_dao/alchemy/userfeatures.py
+1
-2
xivo_dao/alchemy/userlabels.py
xivo_dao/alchemy/userlabels.py
+8
-6
No files found.
xivo_dao/alchemy/__init__.py
View file @
c083ab21
...
...
@@ -20,6 +20,7 @@
from
xivo_dao.alchemy.cti_profile
import
CtiProfile
from
xivo_dao.alchemy.extension
import
Extension
from
xivo_dao.alchemy.linefeatures
import
LineFeatures
from
xivo_dao.alchemy.userlabels
import
UserLabels
from
xivo_dao.alchemy.user_line
import
UserLine
from
xivo_dao.alchemy.userfeatures
import
UserFeatures
from
xivo_dao.alchemy.voicemail
import
Voicemail
xivo_dao/alchemy/all/__init__.py
View file @
c083ab21
...
...
@@ -67,6 +67,7 @@ from xivo_dao.alchemy.groupfeatures import GroupFeatures
from
xivo_dao.alchemy.iaxcallnumberlimits
import
IAXCallNumberLimits
from
xivo_dao.alchemy.incall
import
Incall
from
xivo_dao.alchemy.infos
import
Infos
from
xivo_dao.alchemy.labels
import
Labels
from
xivo_dao.alchemy.ldapfilter
import
LdapFilter
from
xivo_dao.alchemy.ldapserver
import
LdapServer
from
xivo_dao.alchemy.linefeatures
import
LineFeatures
...
...
@@ -136,6 +137,7 @@ from xivo_dao.alchemy.user_line import UserLine
from
xivo_dao.alchemy.usercustom
import
UserCustom
from
xivo_dao.alchemy.userfeatures
import
UserFeatures
from
xivo_dao.alchemy.useriax
import
UserIAX
from
xivo_dao.alchemy.userlabels
import
UserLabels
from
xivo_dao.alchemy.users
import
Users
from
xivo_dao.alchemy.usersip
import
UserSIP
from
xivo_dao.alchemy.voicemail
import
Voicemail
...
...
xivo_dao/alchemy/labels.py
View file @
c083ab21
...
...
@@ -24,7 +24,7 @@ from xivo_dao.helpers.db_manager import Base
class
Labels
(
Base
):
__tablename__
=
'labels'
__table_args__
=
(
PrimaryKeyConstraint
(
'id'
)
PrimaryKeyConstraint
(
'id'
)
,
)
id
=
Column
(
Integer
,
nullable
=
False
,
autoincrement
=
True
)
...
...
xivo_dao/alchemy/userfeatures.py
View file @
c083ab21
...
...
@@ -32,7 +32,6 @@ from xivo_dao.alchemy import enum
from
xivo_dao.alchemy.cti_profile
import
CtiProfile
from
xivo_dao.alchemy.entity
import
Entity
from
xivo_dao.alchemy.func_key_template
import
FuncKeyTemplate
from
xivo_dao.alchemy.userlabels
import
UserLabels
from
xivo_dao.helpers.db_manager
import
Base
...
...
@@ -144,7 +143,7 @@ class UserFeatures(Base):
UserLine.main_line == True)"""
)
voicemail
=
relationship
(
"Voicemail"
)
cti_profile
=
relationship
(
"CtiProfile"
)
labels
=
relationship
(
"
Label"
,
secondary
=
UserLabels
)
labels
=
relationship
(
"
UserLabels"
)
def
extrapolate_caller_id
(
self
,
extension
=
None
):
...
...
xivo_dao/alchemy/userlabels.py
View file @
c083ab21
...
...
@@ -19,9 +19,8 @@ from sqlalchemy.schema import Column, ForeignKeyConstraint, PrimaryKeyConstraint
from
sqlalchemy.types
import
Integer
,
String
from
sqlalchemy.orm
import
relationship
from
xivo_dao.alchemy.userfeatures
import
UserFeatures
from
xivo_dao.alchemy.labels
import
Labels
from
xivo_dao.alchemy.userfeatures
import
UserFeatures
from
xivo_dao.helpers.db_manager
import
Base
...
...
@@ -30,13 +29,16 @@ class UserLabels(Base):
__tablename__
=
'userlabels'
__table_args__
=
(
ForeignKeyConstraint
((
'user
_
id'
,),
ForeignKeyConstraint
((
'userid'
,),
(
'userfeatures.id'
,),
ondelete
=
'RESTRICT'
),
ForeignKeyConstraint
((
'label
_
id'
,),
ForeignKeyConstraint
((
'labelid'
,),
(
'labels.id'
,),
ondelete
=
'RESTRICT'
),
)
users
=
relationship
(
UserFeatures
)
labels
=
relationship
(
Labels
)
userid
=
Column
(
Integer
,
nullable
=
False
)
labelid
=
Column
(
Integer
,
nullable
=
False
)
label
=
relationship
(
Labels
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment