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
bc5d392f
Commit
bc5d392f
authored
Sep 07, 2017
by
Vasyl Bodnaruk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remake create job view for save flag in db
parent
b0a18fea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
views.py
esi/scraper/views.py
+2
-1
new_job.html
esi/templates/new_job.html
+1
-1
No files found.
esi/scraper/views.py
View file @
bc5d392f
...
...
@@ -73,11 +73,12 @@ class NewJobCreateView(CreateView):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
name
=
request
.
POST
.
get
(
'name'
)
scrap_old_news
=
True
if
request
.
POST
.
get
(
'scrap_old_news'
)
else
False
spider
=
Spider
.
objects
.
get
(
pk
=
request
.
POST
.
get
(
'spider'
))
query
=
self
.
_validate_query
(
request
.
POST
.
get
(
'query'
))
if
query
==
BAD_QUERY
:
return
HttpResponse
(
'Bad request'
,
status
=
400
)
job
=
Job
.
objects
.
create
(
name
=
name
,
spider
=
spider
,
query
=
query
)
job
=
Job
.
objects
.
create
(
name
=
name
,
spider
=
spider
,
query
=
query
,
scrap_old_news
=
scrap_old_news
)
interval
=
request
.
POST
.
get
(
'interval'
,
''
)
.
upper
()
print
(
'Interval'
,
interval
)
if
interval
:
...
...
esi/templates/new_job.html
View file @
bc5d392f
...
...
@@ -86,7 +86,7 @@
<label
for=
"name"
class=
"offset-1 col-2 col-form-label"
><strong>
Scrap old news:
</strong></label>
<div
class=
"col-1"
>
<label
class=
"custom-control custom-checkbox"
>
<input
type=
"checkbox"
class=
"custom-control-input
"
>
<input
id=
"old"
type=
"checkbox"
class=
"custom-control-input"
name=
"scrap_old_news
"
>
<span
class=
"custom-control-indicator"
></span>
</label>
</div>
...
...
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