Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bookshare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SRCT
bookshare
Commits
30a044c8
Commit
30a044c8
authored
Feb 25, 2020
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added form_class to create and update views to lookout app as well
parent
a082f9e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
10 deletions
+2
-10
bookshare/lookouts/templates/create_lookout.html
bookshare/lookouts/templates/create_lookout.html
+1
-1
bookshare/lookouts/views.py
bookshare/lookouts/views.py
+1
-9
No files found.
bookshare/lookouts/templates/create_lookout.html
View file @
30a044c8
...
...
@@ -32,7 +32,7 @@ SRCT Bookshare • Create Lookout
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-10 col-md-offset-1"
>
{% crispy
my_
form %}
{% crispy form %}
</div>
</div>
</div>
...
...
bookshare/lookouts/views.py
View file @
30a044c8
...
...
@@ -16,19 +16,11 @@ from core.models import Student
class
CreateLookout
(
LoginRequiredMixin
,
CreateView
):
model
=
Lookout
f
ields
=
[
'isbn'
,
]
f
orm_class
=
LookoutForm
context_object_name
=
'lookout'
template_name
=
'create_lookout.html'
login_url
=
'login'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
CreateLookout
,
self
).
get_context_data
(
**
kwargs
)
form
=
LookoutForm
()
context
[
'my_form'
]
=
form
return
context
def
form_valid
(
self
,
form
):
me
=
self
.
request
.
user
.
student
...
...
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