Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fish
Overview
Overview
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
rongjun
fish
Commits
8944d6e9
Commit
8944d6e9
authored
Oct 09, 2018
by
rongjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
c2a19616
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
views.py
apps/manage/apps/task/views.py
+12
-1
models.py
apps/task/models.py
+3
-0
index.html
templates/manage/apps/task/index.html
+1
-2
No files found.
apps/manage/apps/task/views.py
View file @
8944d6e9
...
...
@@ -3,11 +3,13 @@ from __future__ import absolute_import
from
django.db.models.query_utils
import
Q
from
rest_framework.response
import
Response
from
rest_framework.decorators
import
action
from
core.framework.manageviews
import
TemplateHTMLRendererView
,
\
ManageResponseViewSet
,
ManageListView
,
ManageAddView
,
\
ManageEditView
,
ManageActiveView
,
ManageDeleteView
from
core.framework.permissions
import
IsAuthManager
from
core.framework.pagination
import
ManagePagination
from
core.framework.response
import
MangeAPIResponse
from
apps.task.models
import
Task
from
apps.task.filters
import
ManageTaskFilter
...
...
@@ -30,7 +32,7 @@ class ManageTaskView(TemplateHTMLRendererView):
class
ManageTaskAPIViewSet
(
ManageListView
,
ManageAddView
,
ManageEditView
,
ManageActive
View
,
ManageDeleteView
,
ManageEdit
View
,
ManageDeleteView
,
ManageResponseViewSet
):
model
=
Task
filter_cls
=
ManageTaskFilter
...
...
@@ -39,3 +41,12 @@ class ManageTaskAPIViewSet(ManageListView, ManageAddView,
serializer_class
=
ManageTaskSerializer
add_serializer_class
=
ManageTaskAddSerializer
pagination_class
=
ManagePagination
@action
(
methods
=
[
'post'
],
detail
=
False
)
def
ban
(
self
,
request
,
**
kwargs
):
pk
=
request
.
GET
.
get
(
'id'
)
task
=
Task
.
objects
.
get
(
pk
=
pk
)
task
.
active
=
False
task
.
save
(
update_fields
=
[
'active'
])
task
.
set_active_list
(
task
.
instrument
)
return
MangeAPIResponse
()
apps/task/models.py
View file @
8944d6e9
...
...
@@ -36,6 +36,9 @@ class Task(BaseModel):
'type'
:
al
.
config
.
get
(
'type'
),
'max_val'
:
str
(
al
.
config
.
get
(
'max_val'
)),
'min_val'
:
str
(
al
.
config
.
get
(
'min_val'
))}
dd
.
append
(
d
)
if
not
dd
:
cache
.
set
(
instrument
,
[],
0
)
else
:
cache
.
set
(
instrument
,
dd
,
24
*
60
*
60
)
@staticmethod
...
...
templates/manage/apps/task/index.html
View file @
8944d6e9
...
...
@@ -14,8 +14,7 @@
add_url
=
"{% url 'manage-task-add' %}"
,
edit_url
=
"{% url 'manage-task-edit' %}"
,
delete_url
=
"{% url 'manage-task-delete' %}"
,
ban_url
=
"{% url 'manage-task-ban' %}"
,
reset_url
=
"{% url 'manage-task-reset' %}"
;
ban_url
=
"{% url 'manage-task-ban' %}"
;
function
init
()
{
$
(
fm_add
).
find
(
"select[name='emails']"
).
attr
(
"multiple"
,
true
);
...
...
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