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
94839792
Commit
94839792
authored
Nov 24, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
59ab7047
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
21 deletions
+38
-21
user.json
trans2es/mapping/user.json
+14
-7
pickuserrecord.py
trans2es/models/pickuserrecord.py
+0
-1
user.py
trans2es/models/user.py
+11
-6
user_follow.py
trans2es/models/user_follow.py
+1
-3
user_transfer.py
trans2es/utils/user_transfer.py
+12
-4
No files found.
trans2es/mapping/user.json
View file @
94839792
{
{
"dynamic"
:
"strict"
,
"dynamic"
:
"strict"
,
"properties"
:
{
"properties"
:
{
"id"
:{
"type"
:
"long"
},
"user_id"
:{
"type"
:
"long"
},
"name"
:{
"type"
:
"text"
},
"nick_name"
:{
"type"
:
"text"
},
//昵称
"icon"
:{
"type"
:
"text"
},
"profile_pic"
:{
"type"
:
"text"
},
//头像
"tag_list"
:{
"type"
:
"text"
},
"gender"
:{
"type"
:
"integer"
},
"attention_user_id_list"
:{
"type"
:
"long"
},
"is_online"
:{
"type"
:
"boolean"
},
//是否上线
"pick_user_id_list"
:{
"type"
:
"long"
},
"tag_list"
:{
"type"
:
"text"
},
//标签属性
"same_group_user_id_list"
:{
"type"
:
"text"
}
"city_id"
:{
"type"
:
"long"
},
"country_id"
:{
"type"
:
"long"
},
"attention_user_id_list"
:{
"type"
:
"long"
},
//关注用户列表
"pick_user_id_list"
:{
"type"
:
"long"
},
//pick用户列表
"same_group_user_id_list"
:{
"type"
:
"text"
},
//同组用户列表
"create_time"
:{
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
},
"update_time"
:{
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
}
}
}
}
}
\ No newline at end of file
trans2es/models/pickuserrecord.py
View file @
94839792
...
@@ -18,7 +18,6 @@ class PickUserRecord(models.Model):
...
@@ -18,7 +18,6 @@ class PickUserRecord(models.Model):
app_label
=
'api'
app_label
=
'api'
pickuser_id
=
models
.
IntegerField
(
verbose_name
=
"pick user id"
)
pickuser_id
=
models
.
IntegerField
(
verbose_name
=
"pick user id"
)
#user_id = models.IntegerField(verbose_name="用户ID")
is_deleted
=
models
.
BooleanField
(
verbose_name
=
"是否删除"
)
is_deleted
=
models
.
BooleanField
(
verbose_name
=
"是否删除"
)
is_pick
=
models
.
BooleanField
(
verbose_name
=
"is_pick"
)
is_pick
=
models
.
BooleanField
(
verbose_name
=
"is_pick"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'日记创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'日记创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
...
...
trans2es/models/user.py
View file @
94839792
...
@@ -14,18 +14,23 @@ class User(models.Model):
...
@@ -14,18 +14,23 @@ class User(models.Model):
class
Meta
:
class
Meta
:
verbose_name
=
u'用户'
verbose_name
=
u'用户'
verbose_name_plural
=
u'用户'
verbose_name_plural
=
u'用户'
db_table
=
'user'
db_table
=
'
account_
user'
app_label
=
'api'
app_label
=
'api'
id
=
models
.
IntegerField
(
primary_key
=
True
,
verbose_name
=
"用户ID"
)
user_id
=
models
.
BigIntegerField
(
verbose_name
=
u'用户唯一id'
,
unique
=
True
)
name
=
models
.
CharField
(
verbose_name
=
"用户名称"
)
nick_name
=
models
.
CharField
(
verbose_name
=
u'昵称'
,
max_length
=
255
,
default
=
''
)
icon
=
models
.
CharField
(
verbose_name
=
''
)
profile_pic
=
models
.
CharField
(
verbose_name
=
u'头像'
,
max_length
=
300
)
gender
=
models
.
SmallIntegerField
(
verbose_name
=
u'性别'
)
city_id
=
models
.
IntegerField
(
verbose_name
=
u'城市id'
)
country_id
=
models
.
IntegerField
(
verbose_name
=
'国家id'
)
is_online
=
models
.
BooleanField
(
verbose_name
=
"是否上线"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'日记创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
update_time
=
models
.
DateTimeField
(
verbose_name
=
u'日记更新时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
def
get_follow_user_id_list
(
self
):
def
get_follow_user_id_list
(
self
):
print
(
"********duan add,use attribute:
%
s"
%
str
(
dir
(
self
)))
follow_user_id_list
=
list
()
follow_user_id_list
=
list
()
user_follows
=
self
.
my
userfollow
.
filter
(
is_online
=
True
)
user_follows
=
self
.
userfollow
.
filter
(
is_online
=
True
)
for
user_follow
in
user_follows
:
for
user_follow
in
user_follows
:
follow_user_id_list
.
append
(
user_follow
.
follow_id
)
follow_user_id_list
.
append
(
user_follow
.
follow_id
)
...
...
trans2es/models/user_follow.py
View file @
94839792
...
@@ -17,9 +17,7 @@ class UserFollow(models.Model):
...
@@ -17,9 +17,7 @@ class UserFollow(models.Model):
db_table
=
'user_follow'
db_table
=
'user_follow'
app_label
=
'api'
app_label
=
'api'
#user_id = models.IntegerField(verbose_name="用户ID")
user
=
models
.
ForeignKey
(
User
,
related_name
=
'userfollow'
,
on_delete
=
models
.
CASCADE
)
user
=
models
.
ForeignKey
(
User
,
related_name
=
'myuserfollow'
,
on_delete
=
models
.
CASCADE
)
#user = models.ForeignKey(User, related_name='userFollow',on_delete=models.CASCADE)
follow_id
=
models
.
IntegerField
(
verbose_name
=
"关注的用户ID"
)
follow_id
=
models
.
IntegerField
(
verbose_name
=
"关注的用户ID"
)
is_online
=
models
.
BooleanField
(
verbose_name
=
"是否上线"
)
is_online
=
models
.
BooleanField
(
verbose_name
=
"是否上线"
)
is_deleted
=
models
.
BooleanField
(
verbose_name
=
"是否删除"
)
is_deleted
=
models
.
BooleanField
(
verbose_name
=
"是否删除"
)
...
...
trans2es/utils/user_transfer.py
View file @
94839792
...
@@ -4,6 +4,7 @@ import os
...
@@ -4,6 +4,7 @@ import os
import
sys
import
sys
import
logging
import
logging
import
traceback
import
traceback
from
libs.tools
import
tzlc
class
UserTransfer
(
object
):
class
UserTransfer
(
object
):
...
@@ -12,11 +13,18 @@ class UserTransfer(object):
...
@@ -12,11 +13,18 @@ class UserTransfer(object):
try
:
try
:
res
=
dict
()
res
=
dict
()
res
[
"id"
]
=
instance
.
id
res
[
"user_id"
]
=
instance
.
user_id
res
[
"icon"
]
=
instance
.
icon
res
[
"nick_name"
]
=
instance
.
nick_name
res
[
"name"
]
=
instance
.
name
res
[
"profile_pic"
]
=
instance
.
profile_pic
res
[
"tag_list"
]
=
""
res
[
"gender"
]
=
instance
.
gender
res
[
"city_id"
]
=
instance
.
city_id
res
[
"country_id"
]
=
instance
.
country_id
res
[
"is_online"
]
=
instance
.
is_online
res
[
"create_time"
]
=
tzlc
(
instance
.
create_time
)
res
[
"update_time"
]
=
tzlc
(
instance
.
update_time
)
res
[
"tag_list"
]
=
""
print
(
"follow_user_id_list:
%
s"
%
str
(
instance
.
get_follow_user_id_list
))
print
(
"follow_user_id_list:
%
s"
%
str
(
instance
.
get_follow_user_id_list
))
res
[
"attention_user_id_list"
]
=
instance
.
get_follow_user_id_list
()
res
[
"attention_user_id_list"
]
=
instance
.
get_follow_user_id_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