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
cdd512fc
Commit
cdd512fc
authored
Nov 22, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
d483cf5a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
topic.py
trans2es/models/topic.py
+3
-2
topic_transfer.py
trans2es/utils/topic_transfer.py
+3
-5
No files found.
trans2es/models/topic.py
View file @
cdd512fc
...
...
@@ -7,6 +7,7 @@ import traceback
import
logging
from
libs.es
import
ESPerform
from
django.db
import
models
import
datetime
class
Topic
(
models
.
Model
):
class
Meta
:
...
...
@@ -16,8 +17,8 @@ class Topic(models.Model):
app_label
=
'api'
group_id
=
models
.
IntegerField
(
verbose_name
=
'日记ID'
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
'日记创建时间'
,
auto_now_add
=
True
)
update_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
=
u'日记更新时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
)
)
name
=
models
.
CharField
(
verbose_name
=
'日记名称'
)
user_id
=
models
.
IntegerField
(
verbose_name
=
'用户ID'
)
description
=
models
.
CharField
(
verbose_name
=
'日记本描述'
)
...
...
trans2es/utils/topic_transfer.py
View file @
cdd512fc
...
...
@@ -17,7 +17,6 @@ class TopicTransfer(object):
res
=
dict
()
res
[
"id"
]
=
instance
.
id
print
(
"duan add,id is:
%
d"
%
res
[
"id"
])
res
[
"is_online"
]
=
instance
.
is_online
res
[
"vote_num"
]
=
instance
.
vote_num
res
[
"reply_num"
]
=
instance
.
reply_num
...
...
@@ -29,12 +28,11 @@ class TopicTransfer(object):
res
[
"share_num"
]
=
instance
.
share_num
#
create_time = instance.create_time
create_time
=
"2018-11-21 13:35:34"
create_time
=
instance
.
create_time
print
(
"id is:
%
d,create_time is:
%
s"
%
res
[
"id"
],
str
(
create_time
))
res
[
"create_time"
]
=
tzlc
(
create_time
)
#update_time = instance.update_time
update_time
=
"2018-11-21 13:35:35"
update_time
=
instance
.
update_time
res
[
"update_time"
]
=
tzlc
(
update_time
)
return
res
...
...
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