Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
graces_es6
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
graces_es6
Commits
f512050d
Commit
f512050d
authored
Nov 03, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新es的配置
parent
a4192a46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
type_info.py
trans2es/type_info.py
+26
-26
No files found.
trans2es/type_info.py
View file @
f512050d
...
...
@@ -184,10 +184,10 @@ class TypeInfo(object):
if
not
isinstance
(
es
,
(
list
,
tuple
,)):
es
=
[
es
]
index_type
=
self
.
type
#
index_type = self.type
index_type
=
"_doc"
if
self
.
type
==
'newitemwiki'
or
self
.
type
==
'collectwiki'
or
self
.
type
==
'brandwiki'
or
self
.
type
==
'productwiki'
:
index_type
=
'
newwiki
'
index_type
=
'
_doc
'
index
=
es_index_adapt
(
index_prefix
=
index_prefix
,
...
...
@@ -333,7 +333,7 @@ def get_type_info_map():
type_info_list
=
[
TypeInfo
(
name
=
'tag'
,
# 圈子
type
=
'
_doc
'
,
type
=
'
tag
'
,
model
=
am
.
Tag
,
query_deferred
=
lambda
:
am
.
Tag
.
objects
.
all
()
.
query
,
get_data_func
=
transfer
.
get_tag
,
...
...
@@ -344,7 +344,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'tagv3'
,
# 圈子
type
=
'
_doc
'
,
type
=
'
tagv3
'
,
model
=
TagV3
,
query_deferred
=
lambda
:
TagV3
.
objects
.
all
()
.
query
,
get_data_func
=
transfer
.
get_tagv3
,
...
...
@@ -355,7 +355,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'itemwiki'
,
# 百科
type
=
'
_doc
'
,
type
=
'
itemwiki
'
,
model
=
am
.
ItemWiki
,
query_deferred
=
lambda
:
am
.
ItemWiki
.
objects
.
select_related
(
'tag'
)
.
query
,
get_data_func
=
transfer
.
get_itemwiki
,
...
...
@@ -367,7 +367,7 @@ def get_type_info_map():
TypeInfo
(
name
=
'newitemwiki'
,
# 项目百科tab
type
=
'
_doc
'
,
type
=
'
newitemwiki
'
,
model
=
item
.
NewItemWiki
,
query_deferred
=
lambda
:
item
.
NewItemWiki
.
objects
.
all
()
.
query
,
get_data_func
=
WikiTab_transfer
.
get_ItemWiki
,
...
...
@@ -378,7 +378,7 @@ def get_type_info_map():
TypeInfo
(
name
=
'collectwiki'
,
# 聚合百科tab
type
=
'
_doc
'
,
type
=
'
collectwiki
'
,
model
=
collect
.
CollectWiki
,
query_deferred
=
lambda
:
collect
.
CollectWiki
.
objects
.
all
()
.
query
,
get_data_func
=
WikiTab_transfer
.
get_CollectWiki
,
...
...
@@ -389,7 +389,7 @@ def get_type_info_map():
TypeInfo
(
name
=
'brandwiki'
,
# 品牌产品tab
type
=
'
_doc
'
,
type
=
'
brandwiki
'
,
model
=
brand
.
BrandWiki
,
query_deferred
=
lambda
:
brand
.
BrandWiki
.
objects
.
all
()
.
query
,
get_data_func
=
WikiTab_transfer
.
get_BrandWiki
,
...
...
@@ -400,7 +400,7 @@ def get_type_info_map():
TypeInfo
(
name
=
'productwiki'
,
# 产品百科tab
type
=
'
_doc
'
,
type
=
'
productwiki
'
,
model
=
product
.
ProductWiki
,
query_deferred
=
lambda
:
product
.
ProductWiki
.
objects
.
all
()
.
query
,
get_data_func
=
WikiTab_transfer
.
get_ProductWiki
,
...
...
@@ -410,7 +410,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'wiki_keyword'
,
# 百科keyword
type
=
'
_doc
'
,
type
=
'
wiki_keyword
'
,
model
=
hot_wiki_keyword
.
Wiki_Keyword
,
query_deferred
=
lambda
:
hot_wiki_keyword
.
Wiki_Keyword
.
objects
.
all
()
.
query
,
get_data_func
=
transfer
.
Wiki_keyword
,
...
...
@@ -421,7 +421,7 @@ def get_type_info_map():
TypeInfo
(
name
=
'diary'
,
# 日记本
type
=
'
_doc
'
,
type
=
'
diary
'
,
model
=
Diary
,
# WARNING:
# This code *MUST* be synchronized with trans2es.utils.transfer.get_diary
...
...
@@ -440,7 +440,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'service'
,
# 福利
type
=
'
_doc
'
,
type
=
'
service
'
,
model
=
am
.
Service
,
query_deferred
=
lambda
:
am
.
Service
.
objects
.
select_related
(
'doctor__hospital__city__province'
)
.
query
,
get_data_func
=
service_transfer
.
get_service
,
...
...
@@ -450,7 +450,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'package'
,
type
=
'
_doc
'
,
type
=
'
package
'
,
model
=
UnitRelateService
,
query_deferred
=
lambda
:
UnitRelateService
.
objects
.
filter
(
related_type
=
VisualUnitRelatedServiceType
.
PACKAGE
)
.
query
,
...
...
@@ -461,7 +461,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'package_promotion'
,
type
=
'
_doc
'
,
type
=
'
package_promotion
'
,
model
=
SubmissionCommodity
,
query_deferred
=
lambda
:
SubmissionCommodity
.
objects
.
all
()
.
query
,
get_data_func
=
package_promotion_transfer
.
get_promotion
,
...
...
@@ -471,7 +471,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'lbs'
,
type
=
'
_doc
'
,
type
=
'
lbs
'
,
model
=
SubmissionCommodity
,
query_deferred
=
lambda
:
SubmissionCommodity
.
objects
.
using
(
settings
.
POSEIDON_DB_NAME
)
.
all
()
.
query
,
get_data_func
=
service_transfer
.
lbs_promotion_info
,
...
...
@@ -481,7 +481,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'lbs_clone'
,
type
=
'
_doc
'
,
type
=
'
lbs_clone
'
,
model
=
UnitRelateService
,
query_deferred
=
lambda
:
UnitRelateService
.
objects
.
using
(
settings
.
POSEIDON_DB_NAME
)
.
all
()
.
query
,
get_data_func
=
service_transfer
.
lbs_unit_info
,
...
...
@@ -491,7 +491,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'sku'
,
# sku
type
=
'
_doc
'
,
type
=
'
sku
'
,
model
=
am
.
ServiceItem
,
query_deferred
=
lambda
:
am
.
ServiceItem
.
objects
.
select_related
(
'service__doctor__hospital__city__province'
)
.
query
,
...
...
@@ -502,7 +502,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'doctor'
,
# 医生
type
=
'
_doc
'
,
type
=
'
doctor
'
,
model
=
am
.
Doctor
,
query_deferred
=
lambda
:
am
.
Doctor
.
objects
.
select_related
(
'hospital__city__province'
)
...
...
@@ -516,7 +516,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'consultant'
,
# 医生
type
=
'
_doc
'
,
type
=
'
consultant
'
,
model
=
counsellor
.
Counsellor
,
query_deferred
=
lambda
:
counsellor
.
Counsellor
.
objects
.
all
()
.
query
,
get_data_func
=
consultation_transfer
.
get_consultant
,
...
...
@@ -526,7 +526,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'user'
,
# 用户
type
=
'
_doc
'
,
type
=
'
user
'
,
model
=
am
.
User
,
query_deferred
=
lambda
:
am
.
User
.
objects
.
select_related
(
'userextra'
)
.
query
,
get_data_func
=
user_transfer
.
get_user
,
...
...
@@ -536,7 +536,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'board'
,
# 问答
type
=
'
_doc
'
,
type
=
'
board
'
,
model
=
RankBoard
,
query_deferred
=
lambda
:
RankBoard
.
objects
.
prefetch_related
(
'data_tags'
)
.
query
,
get_data_func
=
board_transfer
.
get_board
,
...
...
@@ -546,7 +546,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
'user_album'
,
# 用户相册
type
=
'
_doc
'
,
type
=
'
user_album
'
,
model
=
am
.
User
,
query_deferred
=
lambda
:
am
.
User
.
objects
.
select_related
(
'userextra'
)
.
query
,
get_data_func
=
user_album_transfer
.
get_user_album
,
...
...
@@ -556,7 +556,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
"group"
,
# 小组
type
=
"
_doc
"
,
type
=
"
group
"
,
model
=
Group
,
query_deferred
=
lambda
:
Group
.
objects
.
all
()
.
query
,
get_data_func
=
group_transfer
.
get_group
,
...
...
@@ -566,7 +566,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
"topic"
,
# 话题
type
=
"
_do
c"
,
type
=
"
topi
c"
,
model
=
Topic
,
query_deferred
=
lambda
:
Topic
.
objects
.
all
()
.
query
,
get_data_func
=
grouptopic_transfer
.
get_topic
,
...
...
@@ -576,7 +576,7 @@ def get_type_info_map():
),
TypeInfo
(
name
=
"special"
,
# 话题
type
=
"
_doc
"
,
type
=
"
special
"
,
model
=
SpecialPool
,
query_deferred
=
lambda
:
SpecialPool
.
objects
.
all
()
.
query
,
get_data_func
=
special_transfer
.
get_special
,
...
...
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