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
alpha
physical
Commits
35f64d3c
Commit
35f64d3c
authored
Mar 19, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
bb8ff985
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
workspace.xml
.idea/workspace.xml
+2
-2
group.py
trans2es/models/group.py
+9
-9
No files found.
.idea/workspace.xml
View file @
35f64d3c
...
...
@@ -237,8 +237,8 @@
</option>
</component>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"-
74
"
/>
<option
name=
"y"
value=
"
23
"
/>
<option
name=
"x"
value=
"-
19
"
/>
<option
name=
"y"
value=
"
57
"
/>
<option
name=
"width"
value=
"1920"
/>
<option
name=
"height"
value=
"724"
/>
</component>
...
...
trans2es/models/group.py
View file @
35f64d3c
...
...
@@ -27,15 +27,15 @@ class Group(models.Model):
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
update_time
=
models
.
DateTimeField
(
verbose_name
=
u'更新时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
#获取前一天4,5星发帖数
def
get_high_quality_topic_num
(
self
):
yesterday
=
datetime
.
datetime
.
now
()
-
datetime
.
timedelta
(
days
=
1
)
yesterday_begin_time
=
"
%
s-
%
s-
%
s 00:00:00"
%
(
yesterday
.
year
,
yesterday
.
month
,
yesterday
.
day
)
yesterday_end_time
=
"
%
s-
%
s-
%
s 23:59:59"
%
(
yesterday
.
year
,
yesterday
.
month
,
yesterday
.
day
)
topic_num
=
self
.
group_topics
.
filter
(
content_level__in
=
(
"4"
,
"5"
),
create_time__gte
=
yesterday_begin_time
,
create_time__lte
=
yesterday_end_time
)
.
count
()
return
topic_num
#
#
获取前一天4,5星发帖数
#
def get_high_quality_topic_num(self):
#
yesterday = datetime.datetime.now()-datetime.timedelta(days=1)
#
yesterday_begin_time = "%s-%s-%s 00:00:00" % (yesterday.year, yesterday.month, yesterday.day)
#
yesterday_end_time = "%s-%s-%s 23:59:59" % (yesterday.year, yesterday.month, yesterday.day)
#
#
topic_num = self.group_topics.filter(content_level__in=("4","5"),create_time__gte=yesterday_begin_time,create_time__lte=yesterday_end_time).count()
#
#
return topic_num
def
detail
(
self
):
result
=
{
...
...
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