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
33fdc40f
Commit
33fdc40f
authored
Feb 18, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
a3f673c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
topic.py
trans2es/models/topic.py
+1
-1
user.py
trans2es/models/user.py
+6
-6
No files found.
trans2es/models/topic.py
View file @
33fdc40f
...
...
@@ -111,7 +111,7 @@ class Topic(models.Model):
tag_name_list
=
list
()
logging
.
info
(
"get tag_id_list :
%
s"
%
tag_id_list
)
for
i
in
range
(
0
,
len
(
tag_name_list
),
1000
):
query_results
=
Tag
.
objects
.
filter
(
id__in
=
tag_id_list
[
i
:
i
+
1000
])
.
values_list
(
"name"
,
flat
=
True
)
query_results
=
Tag
.
objects
.
filter
(
id__in
=
tag_id_list
[
i
:
i
+
1000
])
for
item
in
query_results
:
tag_name_list
.
append
(
item
)
return
tag_name_list
...
...
trans2es/models/user.py
View file @
33fdc40f
...
...
@@ -63,7 +63,7 @@ class User(models.Model):
follow_user_id_list
.
append
(
user_follow
.
follow_id
)
follow_user_detail_list
=
list
()
for
i
in
range
(
0
,
len
(
follow_user_id_list
),
1000
):
sql_data_list
=
User
.
objects
.
filter
(
user_id__in
=
follow_user_id_list
[
i
:
i
+
1000
])
.
values
(
"user_id"
,
"country_id"
)
sql_data_list
=
User
.
objects
.
filter
(
user_id__in
=
follow_user_id_list
[
i
:
i
+
1000
])
for
detail_data
in
sql_data_list
:
item
=
{
"user_id"
:
detail_data
.
user_id
,
...
...
@@ -76,7 +76,7 @@ class User(models.Model):
def
get_attention_group_id_list
(
self
):
try
:
attention_group_id_list
=
list
()
query_results
=
GroupUserRole
.
objects
.
filter
(
is_online
=
True
,
user_id
=
self
.
user_id
)
.
values
(
"group_id"
,
"update_time"
)
query_results
=
GroupUserRole
.
objects
.
filter
(
is_online
=
True
,
user_id
=
self
.
user_id
)
for
item
in
query_results
:
item_dict
=
{
"group_id"
:
item
.
group_id
,
...
...
@@ -97,7 +97,7 @@ class User(models.Model):
pick_user_id_list
=
[]
for
i
in
range
(
0
,
len
(
pick_topic_id_list
),
1000
):
topic_sql_list
=
Topic
.
objects
.
filter
(
id__in
=
pick_topic_id_list
[
i
:
i
+
1000
])
.
values
(
"user_id"
)
topic_sql_list
=
Topic
.
objects
.
filter
(
id__in
=
pick_topic_id_list
[
i
:
i
+
1000
])
for
topic_data
in
topic_sql_list
:
pick_user_id_list
.
append
(
topic_data
.
user_id
)
...
...
@@ -105,7 +105,7 @@ class User(models.Model):
pick_user_detail_list
=
list
()
for
i
in
range
(
0
,
len
(
pick_user_id_list
),
1000
):
sql_data_list
=
User
.
objects
.
filter
(
user_id__in
=
pick_user_id_list
[
i
:
i
+
1000
])
.
values
(
"user_id"
,
"country_id"
)
sql_data_list
=
User
.
objects
.
filter
(
user_id__in
=
pick_user_id_list
[
i
:
i
+
1000
])
for
detail_data
in
sql_data_list
:
item
=
{
"user_id"
:
detail_data
.
user_id
,
...
...
@@ -126,7 +126,7 @@ class User(models.Model):
same_group_detail_list
=
list
()
for
i
in
range
(
0
,
len
(
same_group_user_id_list
),
1000
):
sql_data_list
=
User
.
objects
.
filter
(
user_id__in
=
same_group_user_id_list
[
i
:
i
+
1000
])
.
values
(
"user_id"
,
"country_id"
)
sql_data_list
=
User
.
objects
.
filter
(
user_id__in
=
same_group_user_id_list
[
i
:
i
+
1000
])
for
detail_data
in
sql_data_list
:
item
=
{
"user_id"
:
detail_data
.
user_id
,
...
...
@@ -140,7 +140,7 @@ class User(models.Model):
try
:
user_tag_id_list
=
list
()
query_results
=
AccountUserTag
.
objects
.
filter
(
user
=
self
.
user_id
,
is_deleted
=
False
)
.
values
(
"tag_id"
)
query_results
=
AccountUserTag
.
objects
.
filter
(
user
=
self
.
user_id
,
is_deleted
=
False
)
for
item
in
query_results
:
user_tag_id_list
.
append
(
item
.
tag_id
)
...
...
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