Commit 94839792 authored by 段英荣's avatar 段英荣

modify

parent 59ab7047
{
"dynamic":"strict",
"properties": {
"id":{"type":"long"},
"name":{"type":"text"},
"icon":{"type":"text"},
"tag_list":{"type":"text"},
"attention_user_id_list":{"type":"long"},
"pick_user_id_list":{"type":"long"},
"same_group_user_id_list":{"type":"text"}
"user_id":{"type":"long"},
"nick_name":{"type":"text"}, //昵称
"profile_pic":{"type":"text"}, //头像
"gender":{"type":"integer"},
"is_online":{"type":"boolean"},//是否上线
"tag_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
......@@ -18,7 +18,6 @@ class PickUserRecord(models.Model):
app_label = 'api'
pickuser_id = models.IntegerField(verbose_name="pick user id")
#user_id = models.IntegerField(verbose_name="用户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))
......
......@@ -14,18 +14,23 @@ class User(models.Model):
class Meta:
verbose_name = u'用户'
verbose_name_plural = u'用户'
db_table = 'user'
db_table = 'account_user'
app_label = 'api'
id = models.IntegerField(primary_key=True,verbose_name="用户ID")
name = models.CharField(verbose_name="用户名称")
icon = models.CharField(verbose_name='')
user_id = models.BigIntegerField(verbose_name=u'用户唯一id', unique=True)
nick_name = models.CharField(verbose_name=u'昵称', max_length=255, default='')
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):
print("********duan add,use attribute:%s" % str(dir(self)))
follow_user_id_list = list()
user_follows = self.myuserfollow.filter(is_online=True)
user_follows = self.userfollow.filter(is_online=True)
for user_follow in user_follows:
follow_user_id_list.append(user_follow.follow_id)
......
......@@ -17,9 +17,7 @@ class UserFollow(models.Model):
db_table = 'user_follow'
app_label = 'api'
#user_id = models.IntegerField(verbose_name="用户ID")
user = models.ForeignKey(User,related_name='myuserfollow',on_delete=models.CASCADE)
#user = models.ForeignKey(User, related_name='userFollow',on_delete=models.CASCADE)
user = models.ForeignKey(User,related_name='userfollow',on_delete=models.CASCADE)
follow_id = models.IntegerField(verbose_name="关注的用户ID")
is_online = models.BooleanField(verbose_name="是否上线")
is_deleted = models.BooleanField(verbose_name="是否删除")
......
......@@ -4,6 +4,7 @@ import os
import sys
import logging
import traceback
from libs.tools import tzlc
class UserTransfer(object):
......@@ -12,9 +13,16 @@ class UserTransfer(object):
try:
res = dict()
res["id"] = instance.id
res["icon"] = instance.icon
res["name"] = instance.name
res["user_id"] = instance.user_id
res["nick_name"] = instance.nick_name
res["profile_pic"] = instance.profile_pic
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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment