Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
search_tips
Commits
8442ef9e
Commit
8442ef9e
authored
Jul 03, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Plain Diff
add
parents
894987b3
a61703a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
type_info.py
associate/type_info.py
+17
-7
agile_tag_transfer.py
associate/utils/agile_tag_transfer.py
+2
-4
No files found.
associate/type_info.py
View file @
8442ef9e
...
...
@@ -244,7 +244,11 @@ def get_type_info_map():
name
=
'associate_tag'
,
type
=
'associate_tag'
,
model
=
agile_tag
.
AgileTagType
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
all
()
.
query
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
(
AGILE_TAG_TYPE
.
DOCTOR
,
AGILE_TAG_TYPE
.
HOSPITAL
,
AGILE_TAG_TYPE
.
BRAND
,
AGILE_TAG_TYPE
.
INSTRUMENT
,
AGILE_TAG_TYPE
.
PROJECT
,
AGILE_TAG_TYPE
.
POSITION
,
AGILE_TAG_TYPE
.
UNDEFINED
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_suggest_data_list
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -254,7 +258,8 @@ def get_type_info_map():
name
=
'associate_tag_brand'
,
type
=
'associate_tag_brand'
,
model
=
agile_tag
.
AgileTagType
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
()
.
query
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
(
AGILE_TAG_TYPE
.
BRAND
,
AGILE_TAG_TYPE
.
UNDEFINED
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_suggest_brand_data_list
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -264,7 +269,8 @@ def get_type_info_map():
name
=
'associate_tag_doctor'
,
type
=
'associate_tag_doctor'
,
model
=
agile_tag
.
AgileTagType
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
all
()
.
query
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
(
AGILE_TAG_TYPE
.
DOCTOR
,
AGILE_TAG_TYPE
.
UNDEFINED
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_suggest_doctor_data_list
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -274,7 +280,8 @@ def get_type_info_map():
name
=
'associate_tag_hospital'
,
type
=
'associate_tag_hospital'
,
model
=
agile_tag
.
AgileTagType
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
all
()
.
query
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
(
AGILE_TAG_TYPE
.
UNDEFINED
,
AGILE_TAG_TYPE
.
HOSPITAL
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_suggest_hospital_data_list
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -284,7 +291,8 @@ def get_type_info_map():
name
=
'associate_tag_instrument'
,
type
=
'associate_tag_instrument'
,
model
=
agile_tag
.
AgileTagType
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
all
()
.
query
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
(
AGILE_TAG_TYPE
.
UNDEFINED
,
AGILE_TAG_TYPE
.
INSTRUMENT
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_suggest_instrument_data_list
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -294,7 +302,8 @@ def get_type_info_map():
name
=
'associate_tag_position'
,
type
=
'associate_tag_position'
,
model
=
agile_tag
.
AgileTagType
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
all
()
.
query
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
(
AGILE_TAG_TYPE
.
UNDEFINED
,
AGILE_TAG_TYPE
.
POSITION
,
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_suggest_position_data_list
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -304,7 +313,8 @@ def get_type_info_map():
name
=
'associate_tag_project'
,
type
=
'associate_tag_project'
,
model
=
agile_tag
.
AgileTagType
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
all
()
.
query
,
query_deferred
=
lambda
:
agile_tag
.
AgileTag
.
objects
.
filter
(
AGILE_TAG_TYPE
.
UNDEFINED
,
AGILE_TAG_TYPE
.
PROJECT
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_suggest_project_data_list
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
associate/utils/agile_tag_transfer.py
View file @
8442ef9e
...
...
@@ -50,10 +50,7 @@ class TagTransfer(object):
item_dict
[
"api_agile_tag_recommend_type"
]
=
instance
.
get_api_agile_tag_recommend_type
()
ret_list
.
append
(
item_dict
)
suggest_list
=
get_tips_suggest_list
(
instance
.
name
)
logging
.
info
(
"get ret_list:
%
s"
%
ret_list
)
logging
.
info
(
"get suggest_list:
%
s"
%
ret_list
)
return
(
item_dict
,
suggest_list
)
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
@@ -85,7 +82,6 @@ class TagTransfer(object):
logging
.
info
(
"get ret_list:
%
s"
%
ret_list
)
logging
.
info
(
"get suggest_list:
%
s"
%
ret_list
)
return
(
item_dict
,
suggest_list
)
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
@@ -152,6 +148,8 @@ class TagTransfer(object):
logging
.
info
(
"get ret_list:
%
s"
%
ret_list
)
logging
.
info
(
"get suggest_list:
%
s"
%
ret_list
)
logging
.
info
(
"get ret_list:
%
s"
%
ret_list
)
logging
.
info
(
"get suggest_list:
%
s"
%
ret_list
)
return
(
item_dict
,
suggest_list
)
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
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