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
00724a1a
Commit
00724a1a
authored
Nov 04, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新es的配置
parent
2ce33374
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
14 deletions
+12
-14
diary.py
talos/models/diary/diary.py
+4
-4
diary_transfer.py
trans2es/utils/diary_transfer.py
+8
-10
No files found.
talos/models/diary/diary.py
View file @
00724a1a
...
...
@@ -1400,8 +1400,8 @@ class Diary(models.Model):
def
get_script_diary_index_2
(
self
,
index_limit_start_time
,
index_limit_end_time
,
index_limit_weight2
):
try
:
limit_weight
=
1
start_time
=
int
(
time
.
mktime
(
tzlc
(
index_limit_start_time
)
.
timetuple
()))
end_time
=
int
(
time
.
mktime
(
tzlc
(
index_limit_end_time
)
.
timetuple
()))
start_time
=
int
(
time
.
mktime
(
index_limit_start_time
.
timetuple
()))
end_time
=
int
(
time
.
mktime
(
index_limit_end_time
.
timetuple
()))
now
=
int
(
time
.
time
())
if
start_time
<=
now
and
now
<=
end_time
:
limit_weight
=
index_limit_weight2
...
...
@@ -1412,8 +1412,8 @@ class Diary(models.Model):
def
get_merchant_sink
(
self
,
merchant_sink_start_time
,
merchant_sink_end_time
):
try
:
start_time
=
int
(
time
.
mktime
(
tzlc
(
merchant_sink_start_time
)
.
timetuple
()))
end_time
=
int
(
time
.
mktime
(
tzlc
(
merchant_sink_end_time
)
.
timetuple
()))
start_time
=
int
(
time
.
mktime
(
merchant_sink_start_time
.
timetuple
()))
end_time
=
int
(
time
.
mktime
(
merchant_sink_end_time
.
timetuple
()))
now
=
int
(
time
.
time
())
if
start_time
<=
now
and
now
<=
end_time
:
return
0
...
...
trans2es/utils/diary_transfer.py
View file @
00724a1a
...
...
@@ -584,18 +584,16 @@ def get_diary(instance):
res
[
'anecdote_tag_ids'
]
=
get_tag_v3_anecdote_tag_ids
(
content_id
=
d
.
id
)
res
[
'greatest_hits'
]
=
d
.
get_greatest_hits
(
is_headline
=
d
.
is_headline
,
closure_tag_ids
=
res
[
'closure_tag_ids'
])
res
[
'tag_id_popular'
]
=
1
if
1202
in
res
[
'closure_tag_ids'
]
else
0
index_limit_start_time
=
res
.
get
(
"index_limit_start_time"
,
None
)
index_limit_end_time
=
res
.
get
(
"index_limit_start_time"
,
None
)
index_limit_weight2
=
res
.
get
(
"index_limit_weight2"
,
None
)
if
index_limit_start_time
and
index_limit_end_time
:
res
[
'index_limit_score'
]
=
d
.
get_script_diary_index_2
(
index_limit_start_time
,
index_limit_end_time
,
index_limit_weight2
)
if
"index_limit_start_time"
in
res
and
"index_limit_end_time"
in
res
and
"index_limit_weight2"
in
res
:
res
[
'index_limit_score'
]
=
d
.
get_script_diary_index_2
(
res
[
'index_limit_start_time'
],
res
[
'index_limit_end_time'
],
res
[
'index_limit_weight2'
])
else
:
res
[
'index_limit_score'
]
=
1
merchant_sink_start_time
=
res
.
get
(
"merchant_sink_start_time"
,
None
)
merchant_sink_end_time
=
res
.
get
(
"merchant_sink_end_time"
,
None
)
if
merchant_sink_start_time
and
merchant_sink_end_time
:
res
[
'merchant_sink'
]
=
d
.
get_merchant_sink
(
merchant_sink_start_time
,
merchant_sink_end_time
)
if
"merchant_sink_start_time"
in
res
and
"merchant_sink_end_time"
in
res
:
res
[
'merchant_sink'
]
=
d
.
get_merchant_sink
(
res
[
'merchant_sink_start_time'
],
res
[
'merchant_sink_end_time'
])
else
:
res
[
'merchant_sink'
]
=
1
...
...
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