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
764d20b6
Commit
764d20b6
authored
Apr 04, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
471fd27b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
37 deletions
+125
-37
workspace.xml
.idea/workspace.xml
+83
-36
group.py
search/views/group.py
+42
-1
No files found.
.idea/workspace.xml
View file @
764d20b6
...
...
@@ -2,9 +2,7 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"51c70d7e-a00b-4e4e-8cbb-f80f5801da99"
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$/trans2es/mapping/topic-v1.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/trans2es/mapping/topic-v1.json"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/trans2es/models/topic.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/trans2es/models/topic.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/search/views/group.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/search/views/group.py"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -16,11 +14,23 @@
<usages-collector
id=
"statistics.file.extensions.edit"
>
<counts>
<entry
key=
"json"
value=
"4"
/>
<entry
key=
"py"
value=
"96"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.edit"
>
<counts>
<entry
key=
"JSON"
value=
"4"
/>
<entry
key=
"Python"
value=
"96"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.extensions.open"
>
<counts>
<entry
key=
"py"
value=
"1"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.open"
>
<counts>
<entry
key=
"Python"
value=
"1"
/>
</counts>
</usages-collector>
</session>
...
...
@@ -39,8 +49,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/trans2es/type_info.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
167
"
>
<caret
line=
"3
01"
column=
"45"
selection-start-line=
"301"
selection-start-column=
"45"
selection-end-line=
"301"
selection-end-column=
"45
"
/>
<state
relative-caret-position=
"
243
"
>
<caret
line=
"3
11"
column=
"44"
selection-start-line=
"311"
selection-start-column=
"44"
selection-end-line=
"311"
selection-end-column=
"44
"
/>
</state>
</provider>
</entry>
...
...
@@ -54,10 +64,10 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/trans2es/models/topic.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-
990
"
>
<state
relative-caret-position=
"-
3476
"
>
<caret
line=
"2"
selection-start-line=
"2"
selection-end-line=
"2"
/>
<folding>
<element
signature=
"e#46#118#0"
expanded=
"true"
/>
...
...
@@ -81,8 +91,21 @@
<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=
"224"
>
<caret
line=
"336"
column=
"40"
selection-start-line=
"336"
selection-start-column=
"40"
selection-end-line=
"336"
selection-end-column=
"40"
/>
<state
relative-caret-position=
"-110"
>
<caret
line=
"331"
column=
"30"
lean-forward=
"true"
selection-start-line=
"331"
selection-start-column=
"30"
selection-end-line=
"331"
selection-end-column=
"30"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/search/views/group.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"430"
>
<caret
line=
"224"
column=
"22"
selection-start-line=
"224"
selection-start-column=
"22"
selection-end-line=
"224"
selection-end-column=
"22"
/>
<folding>
<element
signature=
"e#1055#3127#0"
/>
<element
signature=
"e#3228#6813#0"
/>
</folding>
</state>
</provider>
</entry>
...
...
@@ -102,7 +125,7 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/trans2es/utils/topic_transfer.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-1150
"
>
<state
relative-caret-position=
"
105
"
>
<caret
line=
"15"
column=
"8"
selection-start-line=
"15"
selection-start-column=
"8"
selection-end-line=
"15"
selection-end-column=
"8"
/>
</state>
</provider>
...
...
@@ -127,6 +150,7 @@
<list>
<option
value=
"$PROJECT_DIR$/trans2es/mapping/topic-v1.json"
/>
<option
value=
"$PROJECT_DIR$/trans2es/models/topic.py"
/>
<option
value=
"$PROJECT_DIR$/search/views/group.py"
/>
</list>
</option>
</component>
...
...
@@ -148,6 +172,17 @@
<item
name=
"physical"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"physical"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"physical"
type=
"b2602c69:ProjectViewProjectNode"
/>
<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=
"search"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"views"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"physical"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"External Libraries"
type=
"cb654da1:ExternalLibrariesNode"
/>
...
...
@@ -196,8 +231,9 @@
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"0"
y=
"23"
width=
"1280"
height=
"724"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.2494043"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.2494043"
/>
<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"
/>
...
...
@@ -210,7 +246,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
ctive=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"9"
sideWeight=
"0.49960285"
visible=
"true"
weight=
"0.54351395
"
/>
<window_info
a
nchor=
"bottom"
id=
"Terminal"
order=
"9"
sideWeight=
"0.49960285"
visible=
"true"
weight=
"0.0
"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"10"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"11"
sideWeight=
"0.50039715"
side_tool=
"true"
weight=
"0.03284072"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
...
...
@@ -251,67 +287,78 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/models/user
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
search/utils/topic
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
142
"
>
<caret
line=
"
140"
column=
"1"
lean-forward=
"true"
selection-start-line=
"140"
selection-start-column=
"1"
selection-end-line=
"140"
selection-end-column=
"
1"
/>
<state
relative-caret-position=
"
83
"
>
<caret
line=
"
761"
lean-forward=
"true"
selection-start-line=
"761"
selection-end-line=
"76
1"
/>
<folding>
<element
signature=
"e#47#
79
#0"
expanded=
"true"
/>
<element
signature=
"e#47#
61
#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
search/views/topic.py
"
>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/mapping/topic.json
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
224
"
>
<caret
line=
"
336"
column=
"40"
selection-start-line=
"336"
selection-start-column=
"40"
selection-end-line=
"336"
selection-end-column=
"40
"
/>
<state
relative-caret-position=
"
765
"
>
<caret
line=
"
51"
column=
"5"
lean-forward=
"true"
selection-start-line=
"51"
selection-start-column=
"5"
selection-end-line=
"51"
selection-end-column=
"5
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
search/utils/topic.py
"
>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/mapping/topic-v1.json
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"83"
>
<caret
line=
"761"
lean-forward=
"true"
selection-start-line=
"761"
selection-end-line=
"761"
/>
<state
relative-caret-position=
"427"
>
<caret
line=
"52"
lean-forward=
"true"
selection-start-line=
"52"
selection-end-line=
"52"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/models/topic.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-3476"
>
<caret
line=
"2"
selection-start-line=
"2"
selection-end-line=
"2"
/>
<folding>
<element
signature=
"e#4
7#61
#0"
expanded=
"true"
/>
<element
signature=
"e#4
6#118
#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=
"
167
"
>
<caret
line=
"3
01"
column=
"45"
selection-start-line=
"301"
selection-start-column=
"45"
selection-end-line=
"301"
selection-end-column=
"45
"
/>
<state
relative-caret-position=
"
243
"
>
<caret
line=
"3
11"
column=
"44"
selection-start-line=
"311"
selection-start-column=
"44"
selection-end-line=
"311"
selection-end-column=
"44
"
/>
</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=
"
-1150
"
>
<state
relative-caret-position=
"
105
"
>
<caret
line=
"15"
column=
"8"
selection-start-line=
"15"
selection-start-column=
"8"
selection-end-line=
"15"
selection-end-column=
"8"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/trans2es/m
apping/topic.json
"
>
<entry
file=
"file://$PROJECT_DIR$/trans2es/m
odels/user.py
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"765"
>
<caret
line=
"51"
column=
"5"
lean-forward=
"true"
selection-start-line=
"51"
selection-start-column=
"5"
selection-end-line=
"51"
selection-end-column=
"5"
/>
<state
relative-caret-position=
"142"
>
<caret
line=
"140"
column=
"1"
lean-forward=
"true"
selection-start-line=
"140"
selection-start-column=
"1"
selection-end-line=
"140"
selection-end-column=
"1"
/>
<folding>
<element
signature=
"e#47#79#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/mapping/topic-v1.json
"
>
<entry
file=
"file://$PROJECT_DIR$/
search/views/topic.py
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
427
"
>
<caret
line=
"
52"
lean-forward=
"true"
selection-start-line=
"52"
selection-end-line=
"52
"
/>
<state
relative-caret-position=
"
-110
"
>
<caret
line=
"
331"
column=
"30"
lean-forward=
"true"
selection-start-line=
"331"
selection-start-column=
"30"
selection-end-line=
"331"
selection-end-column=
"30
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
trans2es/models/topic
.py"
>
<entry
file=
"file://$PROJECT_DIR$/
search/views/group
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-99
0"
>
<caret
line=
"2
"
selection-start-line=
"2"
selection-end-line=
"
2"
/>
<state
relative-caret-position=
"
43
0"
>
<caret
line=
"2
24"
column=
"22"
selection-start-line=
"224"
selection-start-column=
"22"
selection-end-line=
"224"
selection-end-column=
"2
2"
/>
<folding>
<element
signature=
"e#46#118#0"
expanded=
"true"
/>
<element
signature=
"e#1055#3127#0"
/>
<element
signature=
"e#3228#6813#0"
/>
</folding>
</state>
</provider>
...
...
search/views/group.py
View file @
764d20b6
...
...
@@ -165,7 +165,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
"term"
:
{
"is_online"
:
True
}
},{
},
{
"term"
:
{
"is_deleted"
:
False
}
...
...
@@ -200,3 +200,44 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"pictorial_ids_list"
:
[]}
@bind
(
"physical/search/pictorial_topic_sort"
)
def
pictorial_topic_sort
(
pictorial_id
=-
1
,
offset
=
0
,
size
=
10
):
"""
:remark 小组排序,缺少:前1天发评论人数*x
:param user_id:
:param sort_type:
:param offset:
:param size:
:return:
"""
try
:
if
not
isinstance
(
pictorial_id
,
int
):
user_id
=
-
1
q
=
{
"query"
:{
"term"
:{
"pictorial_id"
:
pictorial_id
}
},
"sort"
:{
"vote_num"
:{
"order"
:
"desc"
}
}
}
pict_pictorial_ids_list
=
[]
# 获取es链接对象
es_cli_obj
=
ESPerform
.
get_cli
()
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"topic"
,
q
,
offset
,
size
)
logging
.
info
(
"get pictorial_topic_sort res:
%
s"
%
result_dict
)
for
item
in
result_dict
[
"hits"
]:
topic_id
=
item
[
"_source"
][
"id"
]
pict_pictorial_ids_list
.
append
(
topic_id
)
return
{
"pict_pictorial_ids_list"
:
pict_pictorial_ids_list
}
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"pict_pictorial_ids_list"
:
[]}
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