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

modify

parent d483cf5a
...@@ -7,6 +7,7 @@ import traceback ...@@ -7,6 +7,7 @@ import traceback
import logging import logging
from libs.es import ESPerform from libs.es import ESPerform
from django.db import models from django.db import models
import datetime
class Topic(models.Model): class Topic(models.Model):
class Meta: class Meta:
...@@ -16,8 +17,8 @@ class Topic(models.Model): ...@@ -16,8 +17,8 @@ class Topic(models.Model):
app_label = 'api' app_label = 'api'
group_id = models.IntegerField(verbose_name='日记ID') group_id = models.IntegerField(verbose_name='日记ID')
create_time = models.DateTimeField(verbose_name='日记创建时间', auto_now_add=True) create_time = models.DateTimeField(verbose_name=u'日记创建时间',default=datetime.datetime.fromtimestamp(0))
update_time = models.DateTimeField(verbose_name='日记更新时间', auto_now_add=True) update_time = models.DateTimeField(verbose_name=u'日记更新时间', default=datetime.datetime.fromtimestamp(0))
name = models.CharField(verbose_name='日记名称') name = models.CharField(verbose_name='日记名称')
user_id = models.IntegerField(verbose_name='用户ID') user_id = models.IntegerField(verbose_name='用户ID')
description = models.CharField(verbose_name='日记本描述') description = models.CharField(verbose_name='日记本描述')
......
...@@ -17,7 +17,6 @@ class TopicTransfer(object): ...@@ -17,7 +17,6 @@ class TopicTransfer(object):
res = dict() res = dict()
res["id"] = instance.id res["id"] = instance.id
print("duan add,id is:%d" % res["id"])
res["is_online"] = instance.is_online res["is_online"] = instance.is_online
res["vote_num"] = instance.vote_num res["vote_num"] = instance.vote_num
res["reply_num"] = instance.reply_num res["reply_num"] = instance.reply_num
...@@ -29,12 +28,11 @@ class TopicTransfer(object): ...@@ -29,12 +28,11 @@ class TopicTransfer(object):
res["share_num"] = instance.share_num res["share_num"] = instance.share_num
#create_time = instance.create_time create_time = instance.create_time
create_time = "2018-11-21 13:35:34" print("id is:%d,create_time is:%s" % res["id"],str(create_time))
res["create_time"] = tzlc(create_time) res["create_time"] = tzlc(create_time)
#update_time = instance.update_time update_time = instance.update_time
update_time = "2018-11-21 13:35:35"
res["update_time"] = tzlc(update_time) res["update_time"] = tzlc(update_time)
return res return res
......
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