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
钟尚武
physical
Commits
b535be91
Commit
b535be91
authored
Aug 21, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
e70ec638
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
topic_models.py
vest/data/topic_models.py
+7
-5
true_comment_one.py
vest/reply/true_comment_one.py
+6
-3
No files found.
vest/data/topic_models.py
View file @
b535be91
...
...
@@ -51,7 +51,9 @@ def get_topic_product_info(topic_id):
def
get_pictorial_tag_by_id
(
pictorial_id
):
try
:
tag_id_list
=
list
(
PictorialTag
.
objects
.
filter
(
pictorial_id
=
pictorial_id
,
is_online
=
True
,
is_collection
=
1
)
.
values_list
(
"tag_id"
,
flat
=
True
))
tag_id_list
=
list
(
PictorialTag
.
objects
.
filter
(
pictorial_id
=
pictorial_id
,
is_online
=
True
,
is_collection
=
1
)
.
values_list
(
"tag_id"
,
flat
=
True
))
return
tag_id_list
except
:
...
...
@@ -76,13 +78,13 @@ def get_pictorial_tag_by_id(pictorial_id):
# return []
def
get_
recomment_data
():
def
get_
edit_comment
():
try
:
last
=
Topic
.
objects
.
count
()
-
1
index1
=
randint
(
0
,
last
)
MyObj1
=
Topic
.
objects
.
all
()[
index1
]
index_data
=
Topic
.
objects
.
all
()[
index1
]
return
index_data
.
type_id
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
[]
return
-
1
vest/reply/true_comment_one.py
View file @
b535be91
import
pymysql
import
traceback
import
logging
from
vest.request.auto_request
import
login
,
time_conv
,
get_comment
,
reply
,
get_product_comment
,
get_face_comment
from
vest.request.auto_request
import
login
,
time_conv
,
get_comment
,
reply
,
get_product_comment
,
get_face_comment
,
\
get_edit_comment
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
from
vest.data.topic_models
import
get_edit_tag_id_list
,
get_pictorial_tag_by_id
,
get_topic_product_info
,
\
...
...
@@ -71,8 +72,10 @@ def true_comment_one():
# 先判断是不是编辑标签
edit_judge
=
get_edit_tag_id_list
(
i
[
1
])
if
len
(
edit_judge
)
>
0
:
# 如果有编辑标签
rand_tag_id
=
random
.
randint
(
0
,
len
(
edit_judge
)
-
1
)
comment
=
get_comment
()
# 去拿他的所属分类 根据分类去拿对应的标签
comment
=
get_edit_comment
()
else
:
# 判断有没有商品信息
product_judge
=
get_topic_product_info
(
i
[
1
])
...
...
@@ -83,7 +86,7 @@ def true_comment_one():
face_judge
=
topic_has_image
(
i
[
1
])
if
face_judge
:
comment
=
get_face_comment
()
#原始评论
#
原始评论
else
:
comment
=
get_comment
()
...
...
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