Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
alpha
physical
Commits
84128d3d
Commit
84128d3d
authored
5 years ago
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
8198a848
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
type_info.py
trans2es/type_info.py
+14
-14
No files found.
trans2es/type_info.py
View file @
84128d3d
...
...
@@ -315,7 +315,7 @@ def get_type_info_map():
name
=
'topic-star'
,
type
=
'topic-star'
,
model
=
topic
.
Topic
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
# 假的
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
# 假的
get_data_func
=
TopicTransfer
.
get_topic_data
,
# 假的
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -325,7 +325,7 @@ def get_type_info_map():
name
=
'topic-star-routing'
,
type
=
'topic-star-routing'
,
model
=
topic
.
Topic
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
TopicTransfer
.
get_topic_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -335,7 +335,7 @@ def get_type_info_map():
name
=
'topic-high-star'
,
# >=4星日记
type
=
'topic-high-star'
,
model
=
topic
.
Topic
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
TopicTransfer
.
get_topic_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -345,7 +345,7 @@ def get_type_info_map():
name
=
'excellect-topic'
,
# 优质帖子
type
=
'excellect-topic'
,
model
=
topic
.
ExcellentTopic
,
query_deferred
=
lambda
:
topic
.
ExcellentTopic
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
topic
.
ExcellentTopic
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
ExcellectTopicTransfer
.
get_excellect_topic_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -355,7 +355,7 @@ def get_type_info_map():
name
=
'topic'
,
# 日记
type
=
'topic'
,
model
=
topic
.
Topic
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
TopicTransfer
.
get_topic_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -365,7 +365,7 @@ def get_type_info_map():
name
=
'topic-v1'
,
# 日记
type
=
'topic-v1'
,
model
=
topic
.
Topic
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
topic
.
Topic
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
TopicTransfer
.
get_topic_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -377,7 +377,7 @@ def get_type_info_map():
model
=
user
.
User
,
# query_deferred=lambda:user.User.objects.all().query,
# query_deferred=lambda: user.User.objects.prefetch_related('myuserfollow').query,
query_deferred
=
lambda
:
user
.
User
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
user
.
User
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
UserTransfer
.
get_user_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -399,7 +399,7 @@ def get_type_info_map():
type
=
"celebrity"
,
model
=
celebrity
.
Celebrity
,
# query_deferred=lambda:user.User.objects.all().query,
query_deferred
=
lambda
:
celebrity
.
Celebrity
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
celebrity
.
Celebrity
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
CelebrityTransfer
.
get_celebrity_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -410,7 +410,7 @@ def get_type_info_map():
type
=
"group"
,
model
=
group
.
Group
,
# query_deferred=lambda:user.User.objects.all().query,
query_deferred
=
lambda
:
group
.
Group
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
group
.
Group
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
GroupTransfer
.
get_group_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -420,7 +420,7 @@ def get_type_info_map():
name
=
"tag"
,
# 标签
type
=
"tag"
,
model
=
tag
.
Tag
,
query_deferred
=
lambda
:
tag
.
Tag
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
tag
.
Tag
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -430,7 +430,7 @@ def get_type_info_map():
name
=
"tag_v1"
,
# 标签
type
=
"tag_v1"
,
model
=
tag
.
Tag
,
query_deferred
=
lambda
:
tag
.
Tag
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
tag
.
Tag
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -440,7 +440,7 @@ def get_type_info_map():
name
=
"tag-name"
,
# 标签名字
type
=
"tag-name"
,
model
=
tag
.
Tag
,
query_deferred
=
lambda
:
tag
.
Tag
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
tag
.
Tag
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
TagTransfer
.
get_tag_name_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -450,7 +450,7 @@ def get_type_info_map():
name
=
'contrast_similar'
,
# facesimilar
type
=
'contrast_similar'
,
model
=
contrast_similar
.
ContrastSimilar
,
query_deferred
=
lambda
:
contrast_similar
.
ContrastSimilar
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
contrast_similar
.
ContrastSimilar
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
Contrast_Similar_Transfer
.
get_contrast_similar_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
@@ -460,7 +460,7 @@ def get_type_info_map():
name
=
"pictorial"
,
# 画报
type
=
"pictorial"
,
model
=
pictorial
.
Pictorial
,
query_deferred
=
lambda
:
pictorial
.
Pictorial
.
objects
.
all
(
settings
.
SLAVE2_DB_NAME
)
.
query
,
query_deferred
=
lambda
:
pictorial
.
Pictorial
.
objects
.
using
(
settings
.
SLAVE2_DB_NAME
)
.
all
(
)
.
query
,
get_data_func
=
PictorialTransfer
.
get_poctorial_data
,
bulk_insert_chunk_size
=
100
,
round_insert_chunk_size
=
5
,
...
...
This diff is collapsed.
Click to expand it.
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