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
09ae3321
Commit
09ae3321
authored
Nov 30, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
65e5a924
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
pickuserrecord.py
trans2es/models/pickuserrecord.py
+3
-3
user.py
trans2es/models/user.py
+10
-3
No files found.
trans2es/models/pickuserrecord.py
View file @
09ae3321
...
...
@@ -13,10 +13,10 @@ from .user import User
class
PickUserRecord
(
models
.
Model
):
class
Meta
:
verbose_name
=
u'用户
之间pick
'
db_table
=
'pick
user
record'
verbose_name
=
u'用户
pick帖子
'
db_table
=
'pick
topic
record'
pick
user_id
=
models
.
IntegerField
(
verbose_name
=
"pick user
id"
)
pick
topic_id
=
models
.
IntegerField
(
verbose_name
=
"pick topic
id"
)
is_deleted
=
models
.
BooleanField
(
verbose_name
=
"是否删除"
)
is_pick
=
models
.
BooleanField
(
verbose_name
=
"is_pick"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
...
...
trans2es/models/user.py
View file @
09ae3321
...
...
@@ -13,6 +13,7 @@ from libs.tools import tzlc
from
.group_user_role
import
GroupUserRole
from
.tag
import
AccountUserTag
from
.topic
import
Topic
class
User
(
models
.
Model
):
...
...
@@ -66,11 +67,17 @@ class User(models.Model):
return
[]
def
get_pick_user_id_list
(
self
):
pick_
user
_id_list
=
list
()
user_picks
=
self
.
user_pick
.
filter
(
is_deleted
=
False
)
pick_
topic
_id_list
=
list
()
user_picks
=
self
.
user_pick
.
filter
(
is_deleted
=
False
,
is_pick
=
True
)
for
user_pick
in
user_picks
:
pick_
user_id_list
.
append
(
user_pick
.
pickuser
_id
)
pick_
topic_id_list
.
append
(
user_pick
.
picktopic
_id
)
pick_user_id_list
=
[]
topic_sql_list
=
Topic
.
objects
.
filter
(
id__in
=
pick_topic_id_list
)
for
topic_data
in
topic_sql_list
:
pick_user_id_list
.
append
(
topic_data
.
user_id
)
pick_user_id_list
=
tuple
(
pick_user_id_list
)
pick_user_detail_list
=
list
()
sql_data_list
=
User
.
objects
.
filter
(
user_id__in
=
pick_user_id_list
)
for
detail_data
in
sql_data_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