Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
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
e8c38b8f
Commit
e8c38b8f
authored
Apr 02, 2020
by
Tomas Taraba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3162 Return HintWithOptions when querying for user hints
parent
00b36b25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
xivo_dao/resources/func_key/hint_dao.py
xivo_dao/resources/func_key/hint_dao.py
+9
-7
xivo_dao/resources/func_key/model.py
xivo_dao/resources/func_key/model.py
+1
-0
No files found.
xivo_dao/resources/func_key/hint_dao.py
View file @
e8c38b8f
...
...
@@ -41,7 +41,7 @@ from xivo_dao.alchemy.func_key_mapping import FuncKeyMapping
from
xivo_dao.alchemy.callfiltermember
import
Callfiltermember
from
xivo_dao.alchemy.callfilter
import
Callfilter
from
xivo_dao.resources.func_key.model
import
Hint
from
xivo_dao.resources.func_key.model
import
Hint
,
HintWithOptions
def
_find_extenfeatures
(
session
,
typeval
):
...
...
@@ -90,7 +90,8 @@ def user_hints(session, context):
(
LineFeatures
.
protocol
==
'sccp'
,
literal_column
(
"'SCCP/'"
)
+
SCCPLine
.
name
),
(
LineFeatures
.
protocol
==
'custom'
,
UserCustom
.
interface
)
]).
label
(
'argument'
),
LineFeatures
.
configregistrar
.
label
(
'mediaserver'
))
LineFeatures
.
configregistrar
.
label
(
'mediaserver'
),
UserSIP
.
_options
.
label
(
'options'
))
.
join
(
UserLine
.
userfeatures
)
.
join
(
UserLine
.
linefeatures
)
.
outerjoin
(
UserSIP
,
...
...
@@ -114,10 +115,11 @@ def user_hints(session, context):
.
filter
(
Extension
.
context
==
context
)
.
filter
(
UserFeatures
.
enablehint
==
1
))
return
tuple
(
Hint
(
user_id
=
row
.
user_id
,
extension
=
row
.
extension
,
argument
=
row
.
argument
,
mediaserver
=
row
.
mediaserver
)
return
tuple
(
HintWithOptions
(
user_id
=
row
.
user_id
,
extension
=
row
.
extension
,
argument
=
row
.
argument
,
mediaserver
=
row
.
mediaserver
,
options
=
row
.
options
)
for
row
in
query
)
...
...
@@ -219,7 +221,7 @@ def bsfilter_hints(session, context):
bsfilter_extension
=
clean_extension
(
_find_extenfeatures
(
session
,
'bsfilter'
))
query
=
(
session
.
query
(
sql
.
cast
(
FuncKeyDestBSFilter
.
filtermember_id
,
Unicode
).
label
(
'argument'
),
LineFeatures
.
configregistrar
.
label
(
'mediaserver'
))
LineFeatures
.
configregistrar
.
label
(
'mediaserver'
))
.
join
(
Callfiltermember
,
Callfiltermember
.
id
==
FuncKeyDestBSFilter
.
filtermember_id
)
.
join
(
Callfilter
,
...
...
xivo_dao/resources/func_key/model.py
View file @
e8c38b8f
...
...
@@ -226,4 +226,5 @@ class ForwardTypeConverter(object):
Hint
=
namedtuple
(
'Hint'
,
[
'user_id'
,
'extension'
,
'argument'
,
'mediaserver'
])
HintWithOptions
=
namedtuple
(
'Hint'
,
[
'user_id'
,
'extension'
,
'argument'
,
'mediaserver'
,
'options'
])
Forward
=
namedtuple
(
'Forward'
,
[
'user_id'
,
'type'
,
'number'
])
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