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
94bcbd51
Commit
94bcbd51
authored
Mar 20, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
ed5f1f69
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
121 deletions
+131
-121
workspace.xml
.idea/workspace.xml
+109
-108
topic.py
trans2es/models/topic.py
+22
-13
No files found.
.idea/workspace.xml
View file @
94bcbd51
...
...
@@ -3,7 +3,6 @@
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"d7dd36ca-85ef-4a59-9db5-8b1ee4993a4e"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/search/utils/group.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/search/utils/group.py"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
...
...
@@ -66,29 +65,31 @@
<usages-collector
id=
"statistics.file.extensions.open"
>
<counts>
<entry
key=
"json"
value=
"6"
/>
<entry
key=
"py"
value=
"6
1
"
/>
<entry
key=
"template"
value=
"
2
"
/>
<entry
key=
"py"
value=
"6
6
"
/>
<entry
key=
"template"
value=
"
3
"
/>
<entry
key=
"xml"
value=
"1"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.open"
>
<counts>
<entry
key=
"JSON"
value=
"6"
/>
<entry
key=
"PLAIN_TEXT"
value=
"
2
"
/>
<entry
key=
"Python"
value=
"6
1
"
/>
<entry
key=
"PLAIN_TEXT"
value=
"
3
"
/>
<entry
key=
"Python"
value=
"6
6
"
/>
<entry
key=
"XML"
value=
"1"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.extensions.edit"
>
<counts>
<entry
key=
"json"
value=
"56"
/>
<entry
key=
"py"
value=
"778"
/>
<entry
key=
"py"
value=
"795"
/>
<entry
key=
"template"
value=
"5"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.edit"
>
<counts>
<entry
key=
"JSON"
value=
"56"
/>
<entry
key=
"Python"
value=
"778"
/>
<entry
key=
"PLAIN_TEXT"
value=
"5"
/>
<entry
key=
"Python"
value=
"795"
/>
</counts>
</usages-collector>
</session>
...
...
@@ -98,8 +99,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/search/views/topic.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
352
"
>
<caret
line=
"2
86"
column=
"42"
lean-forward=
"true"
selection-start-line=
"286"
selection-start-column=
"42"
selection-end-line=
"286"
selection-end-column=
"42
"
/>
<state
relative-caret-position=
"
705
"
>
<caret
line=
"2
44"
lean-forward=
"true"
selection-start-line=
"244"
selection-end-line=
"244
"
/>
<folding>
<element
signature=
"e#466#1607#0"
/>
<element
signature=
"e#1776#6597#0"
/>
...
...
@@ -130,8 +131,8 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/search/utils/group.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"4
91
"
>
<caret
line=
"7
3"
column=
"12"
selection-start-line=
"73"
selection-start-column=
"12"
selection-end-line=
"73"
selection-end-column=
"12
"
/>
<state
relative-caret-position=
"4
27
"
>
<caret
line=
"7
4"
column=
"49"
lean-forward=
"true"
selection-start-line=
"74"
selection-start-column=
"49"
selection-end-line=
"74"
selection-end-column=
"49
"
/>
<folding>
<element
signature=
"e#218#1347#0"
/>
</folding>
...
...
@@ -140,64 +141,65 @@
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/
search/utils/topic
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/type_info
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-796
"
>
<caret
line=
"
483"
column=
"8"
selection-start-line=
"483"
selection-start-column=
"8"
selection-end-line=
"483"
selection-end-column=
"8
"
/>
<state
relative-caret-position=
"
225
"
>
<caret
line=
"
262"
column=
"21"
lean-forward=
"true"
selection-start-line=
"262"
selection-start-column=
"21"
selection-end-line=
"262"
selection-end-column=
"21
"
/>
<folding>
<element
signature=
"e#47#61#0"
expanded=
"true"
/>
<element
signature=
"e#5577#6100#0"
/>
<element
signature=
"e#6165#6547#0"
/>
<element
signature=
"e#6611#6863#0"
/>
<element
signature=
"e#6921#7167#0"
/>
<element
signature=
"e#12084#12118#0"
/>
<element
signature=
"e#15#87#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/
injection/data_sync/tasks
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/models/topic
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-60"
>
<caret
line=
"27"
column=
"26"
lean-forward=
"true"
selection-start-line=
"27"
selection-start-column=
"26"
selection-end-line=
"27"
selection-end-column=
"26"
/>
<state
relative-caret-position=
"407"
>
<caret
line=
"90"
column=
"16"
selection-start-line=
"90"
selection-start-column=
"16"
selection-end-line=
"90"
selection-end-column=
"16"
/>
<folding>
<element
signature=
"e#46#118#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/
physical/celery
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/utils/topic_transfer
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<state
relative-caret-position=
"150"
>
<caret
line=
"12"
column=
"6"
selection-start-line=
"12"
selection-start-column=
"6"
selection-end-line=
"12"
selection-end-column=
"6"
/>
<folding>
<element
signature=
"e#
0#56
#0"
expanded=
"true"
/>
<element
signature=
"e#
46#55
#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/
physical/celery_task_router
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
injection/data_sync/tasks
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
300
"
>
<caret
line=
"2
5"
column=
"23"
lean-forward=
"true"
selection-start-line=
"25"
selection-start-column=
"23"
selection-end-line=
"25"
selection-end-column=
"23
"
/>
<state
relative-caret-position=
"
255
"
>
<caret
line=
"2
7"
column=
"27"
lean-forward=
"true"
selection-start-line=
"27"
selection-start-column=
"27"
selection-end-line=
"27"
selection-end-column=
"27
"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/physical/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/physical/views.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/physical/wsgi.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<entry
file=
"file://$PROJECT_DIR$/search/utils/topic.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-796"
>
<caret
line=
"483"
column=
"8"
selection-start-line=
"483"
selection-start-column=
"8"
selection-end-line=
"483"
selection-end-column=
"8"
/>
<folding>
<element
signature=
"e#47#61#0"
expanded=
"true"
/>
<element
signature=
"e#5577#6100#0"
/>
<element
signature=
"e#6165#6547#0"
/>
<element
signature=
"e#6611#6863#0"
/>
<element
signature=
"e#6921#7167#0"
/>
<element
signature=
"e#12084#12118#0"
/>
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
...
...
@@ -217,10 +219,10 @@
<find>
GroupTransfer
</find>
<find>
get_group_query_result
</find>
<find>
get_group_ids_by_aggs
</find>
<find>
ES_INDEX_PREFIX
</find>
<find>
pictorial_id
</find>
<find>
pictorial_name
</find>
<find>
get_recommend_topic_ids
</find>
<find>
ES_INDEX_PREFIX
</find>
<find>
pictorial
</find>
<find>
group
</find>
</findStrings>
...
...
@@ -252,6 +254,7 @@
<option
value=
"$PROJECT_DIR$/trans2es/models/topic.py"
/>
<option
value=
"$PROJECT_DIR$/search/utils/topic.py"
/>
<option
value=
"$PROJECT_DIR$/search/utils/group.py"
/>
<option
value=
"$PROJECT_DIR$/physical/settings_local.py.template"
/>
</list>
</option>
</component>
...
...
@@ -305,6 +308,11 @@
<item
name=
"physical"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"search"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"physical"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"physical"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"trans2es"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</expand>
<select
/>
</subPane>
...
...
@@ -353,7 +361,7 @@
<frame
x=
"-309"
y=
"-1080"
width=
"1920"
height=
"1080"
extended-state=
"6"
/>
<editor
active=
"true"
/>
<layout>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.18114798"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.18114798"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
id=
"DB Browser"
order=
"2"
/>
<window_info
id=
"Favorites"
order=
"3"
side_tool=
"true"
/>
...
...
@@ -366,7 +374,7 @@
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"7"
show_stripe_button=
"false"
/>
<window_info
anchor=
"bottom"
id=
"DB Execution Console"
order=
"8"
/>
<window_info
a
nchor=
"bottom"
id=
"Terminal"
order=
"9"
visible=
"true"
weight=
"0.17202072
"
/>
<window_info
a
ctive=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"9"
visible=
"true"
weight=
"0.0
"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"10"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"11"
side_tool=
"true"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
...
...
@@ -538,16 +546,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/type_info.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"157"
>
<caret
line=
"253"
column=
"10"
selection-start-line=
"253"
selection-start-column=
"10"
selection-end-line=
"253"
selection-end-column=
"10"
/>
<folding>
<element
signature=
"e#15#87#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/management/commands/trans2es_data2es_parallel.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"585"
>
...
...
@@ -561,20 +559,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/libs/es.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"120"
>
<caret
line=
"17"
column=
"43"
selection-start-line=
"17"
selection-start-column=
"28"
selection-end-line=
"17"
selection-end-column=
"43"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/physical/settings_local.py.template"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"163"
>
<caret
line=
"146"
selection-start-line=
"146"
selection-end-line=
"146"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/models/user.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"285"
>
...
...
@@ -612,33 +596,6 @@
<entry
file=
"file://$PROJECT_DIR$/search/views/pick.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/utils/topic_transfer.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"150"
>
<caret
line=
"10"
lean-forward=
"true"
selection-start-line=
"10"
selection-end-line=
"10"
/>
<folding>
<element
signature=
"e#46#55#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/models/topic.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"375"
>
<caret
line=
"90"
column=
"16"
selection-start-line=
"90"
selection-start-column=
"16"
selection-end-line=
"90"
selection-end-column=
"16"
/>
<folding>
<element
signature=
"e#46#118#0"
expanded=
"true"
/>
<element
signature=
"e#4424#4567#0"
/>
<element
signature=
"e#4608#4997#0"
/>
<element
signature=
"e#5039#5438#0"
/>
<element
signature=
"e#5485#6371#0"
/>
<element
signature=
"e#6427#6940#0"
/>
<element
signature=
"e#6989#8758#0"
/>
<element
signature=
"e#8801#9305#0"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/mapping/topic.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"645"
>
...
...
@@ -656,13 +613,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/injection/data_sync/tasks.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-60"
>
<caret
line=
"27"
column=
"26"
lean-forward=
"true"
selection-start-line=
"27"
selection-start-column=
"26"
selection-end-line=
"27"
selection-end-column=
"26"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/physical/celery.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
...
...
@@ -682,10 +632,17 @@
<entry
file=
"file://$PROJECT_DIR$/physical/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/physical/
views
.py"
>
<entry
file=
"file://$PROJECT_DIR$/physical/
wsgi
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/physical/wsgi.py"
>
<entry
file=
"file://$PROJECT_DIR$/physical/settings_local.py.template"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1837"
>
<caret
line=
"146"
column=
"26"
selection-start-line=
"146"
selection-start-column=
"26"
selection-end-line=
"146"
selection-end-column=
"26"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/physical/views.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/search/utils/topic.py"
>
...
...
@@ -703,10 +660,54 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/libs/es.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"120"
>
<caret
line=
"17"
column=
"43"
selection-start-line=
"17"
selection-start-column=
"28"
selection-end-line=
"17"
selection-end-column=
"43"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/injection/data_sync/tasks.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"255"
>
<caret
line=
"27"
column=
"27"
lean-forward=
"true"
selection-start-line=
"27"
selection-start-column=
"27"
selection-end-line=
"27"
selection-end-column=
"27"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/utils/topic_transfer.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"150"
>
<caret
line=
"12"
column=
"6"
selection-start-line=
"12"
selection-start-column=
"6"
selection-end-line=
"12"
selection-end-column=
"6"
/>
<folding>
<element
signature=
"e#46#55#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/type_info.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"225"
>
<caret
line=
"262"
column=
"21"
lean-forward=
"true"
selection-start-line=
"262"
selection-start-column=
"21"
selection-end-line=
"262"
selection-end-column=
"21"
/>
<folding>
<element
signature=
"e#15#87#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/models/topic.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"407"
>
<caret
line=
"90"
column=
"16"
selection-start-line=
"90"
selection-start-column=
"16"
selection-end-line=
"90"
selection-end-column=
"16"
/>
<folding>
<element
signature=
"e#46#118#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/search/views/topic.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
352
"
>
<caret
line=
"2
86"
column=
"42"
lean-forward=
"true"
selection-start-line=
"286"
selection-start-column=
"42"
selection-end-line=
"286"
selection-end-column=
"42
"
/>
<state
relative-caret-position=
"
705
"
>
<caret
line=
"2
44"
lean-forward=
"true"
selection-start-line=
"244"
selection-end-line=
"244
"
/>
<folding>
<element
signature=
"e#466#1607#0"
/>
<element
signature=
"e#1776#6597#0"
/>
...
...
@@ -733,8 +734,8 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/search/utils/group.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"4
91
"
>
<caret
line=
"7
3"
column=
"12"
selection-start-line=
"73"
selection-start-column=
"12"
selection-end-line=
"73"
selection-end-column=
"12
"
/>
<state
relative-caret-position=
"4
27
"
>
<caret
line=
"7
4"
column=
"49"
lean-forward=
"true"
selection-start-line=
"74"
selection-start-column=
"49"
selection-end-line=
"74"
selection-end-column=
"49
"
/>
<folding>
<element
signature=
"e#218#1347#0"
/>
</folding>
...
...
trans2es/models/topic.py
View file @
94bcbd51
...
...
@@ -85,10 +85,13 @@ class Topic(models.Model):
platform_id
=
models
.
BigIntegerField
(
verbose_name
=
'用平台ID'
,
null
=
True
)
def
get_pictorial_id
(
self
):
try
:
try
logging
.
info
(
"get user id :
%
s"
%
self
.
id
)
pictorial_id
=
PictorialTopic
.
objects
.
filter
(
topic_id
=
self
.
id
)
if
len
(
pictorial_id
)
>
0
:
logging
.
info
(
"get user attention pictorial id :
%
s"
%
pictorial_id
)
if
len
(
pictorial_id
)
>
0
:
logging
.
info
(
"get user attention pictorial id :
%
s"
%
pictorial_id
)
return
pictorial_id
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
@@ -107,7 +110,8 @@ class Topic(models.Model):
try
:
has_image
=
False
query_list
=
TopicImage
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
is_deleted
=
False
,
is_online
=
True
)
query_list
=
TopicImage
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
is_deleted
=
False
,
is_online
=
True
)
if
len
(
query_list
)
>
0
:
has_image
=
True
...
...
@@ -133,12 +137,13 @@ class Topic(models.Model):
topic_tag_id_list
=
list
()
edit_tag_id_list
=
list
()
tag_id_list
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
)
.
values_list
(
"tag_id"
,
flat
=
True
)
tag_id_list
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
)
.
values_list
(
"tag_id"
,
flat
=
True
)
tag_query_results
=
Tag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
id__in
=
tag_id_list
)
for
tag_item
in
tag_query_results
:
is_online
=
tag_item
.
is_online
is_deleted
=
tag_item
.
is_deleted
collection
=
tag_item
.
collection
is_online
=
tag_item
.
is_online
is_deleted
=
tag_item
.
is_deleted
collection
=
tag_item
.
collection
if
is_online
and
not
is_deleted
:
topic_tag_id_list
.
append
(
tag_item
.
id
)
...
...
@@ -148,7 +153,7 @@ class Topic(models.Model):
return
(
topic_tag_id_list
,
edit_tag_id_list
)
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
([],[])
return
([],
[])
def
get_tag_name_list
(
self
,
tag_id_list
):
try
:
...
...
@@ -188,9 +193,12 @@ class Topic(models.Model):
elif
self
.
content_level
==
'3'
:
offline_score
+=
2.0
exposure_count
=
ActionSumAboutTopic
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
data_type
=
1
)
.
count
()
click_count
=
ActionSumAboutTopic
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
data_type
=
2
)
.
count
()
uv_num
=
ActionSumAboutTopic
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
data_type
=
3
)
.
count
()
exposure_count
=
ActionSumAboutTopic
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
data_type
=
1
)
.
count
()
click_count
=
ActionSumAboutTopic
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
data_type
=
2
)
.
count
()
uv_num
=
ActionSumAboutTopic
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
self
.
id
,
data_type
=
3
)
.
count
()
if
exposure_count
>
0
:
offline_score
+=
click_count
/
exposure_count
...
...
@@ -221,6 +229,7 @@ class TopicComplaint(models.Model):
id
=
models
.
IntegerField
(
verbose_name
=
'日记图片ID'
,
primary_key
=
True
)
user_id
=
models
.
BigIntegerField
(
verbose_name
=
u'用户ID'
,
db_index
=
True
)
topic
=
models
.
ForeignKey
(
Topic
,
verbose_name
=
u"关联的帖子"
,
null
=
True
,
blank
=
True
,
default
=
None
,
on_delete
=
models
.
CASCADE
,
related_name
=
'complaints'
)
Topic
,
verbose_name
=
u"关联的帖子"
,
null
=
True
,
blank
=
True
,
default
=
None
,
on_delete
=
models
.
CASCADE
,
related_name
=
'complaints'
)
is_online
=
models
.
BooleanField
(
verbose_name
=
u"是否有效"
,
default
=
True
)
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