Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esi-table-data
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esi-data-scrapping
esi-table-data
Commits
6cd46b32
Commit
6cd46b32
authored
Sep 25, 2017
by
Andrii Marynets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add count to form
parent
e1ff884a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
forms.py
esi/scraper/forms.py
+2
-2
views.py
esi/scraper/views.py
+1
-4
No files found.
esi/scraper/forms.py
View file @
6cd46b32
...
...
@@ -25,5 +25,5 @@ class CreateJobForm(forms.ModelForm):
class
Meta
:
model
=
Job
fields
=
[
'name'
,
'query'
,
'scrap_old_news'
,
'spider'
]
exclude
=
[
'job_uuid'
,
'create_time'
,
'end_time'
,
'status'
,
'schedule_job'
,
'interval'
,
'count'
]
\ No newline at end of file
fields
=
[
'name'
,
'query'
,
'scrap_old_news'
,
'spider'
,
'count'
]
exclude
=
[
'job_uuid'
,
'create_time'
,
'end_time'
,
'status'
,
'schedule_job'
,
'interval'
]
\ No newline at end of file
esi/scraper/views.py
View file @
6cd46b32
...
...
@@ -81,12 +81,9 @@ class NewJobCreateView(CreateView):
return
HttpResponse
(
'Bad request'
,
status
=
400
)
interval
=
request
.
POST
.
get
(
'interval'
,
''
)
.
upper
()
if
interval
:
count
=
request
.
POST
.
get
(
'count'
)
count
=
int
(
count
)
if
count
else
None
job
.
interval
=
interval
job
.
count
=
count
job
.
save
()
job
.
schedule_job
=
make_periodic_task
(
job
.
id
,
schedule
(
interval
,
count
))
job
.
schedule_job
=
make_periodic_task
(
job
.
id
,
schedule
(
interval
,
job
.
count
))
job
.
save
()
return
HttpResponseRedirect
(
reverse
(
'job_list'
))
...
...
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