Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
28e9cc7d
Commit
28e9cc7d
authored
Feb 15, 2016
by
Okhin
Browse files
Fixing the JSONMixin and the LookupView. Issue #22
parent
0f4aa8fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
bt/views.py
View file @
28e9cc7d
...
...
@@ -144,7 +144,7 @@ def sendverifymail(service,to,body):
class
JSONMixin
(
object
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
return
http
.
HttpResponse
(
serializers
.
serialize
(
'json'
,
self
.
get_queryset
()))
return
HttpResponse
(
serializers
.
serialize
(
'json'
,
self
.
get_queryset
()))
class
AddForm
(
FormView
,
MultipleObjectMixin
):
template
=
'index.html'
...
...
@@ -259,9 +259,9 @@ def get_attach(request,id):
response
[
'Content-Length'
]
=
f
.
storage
.
size
return
response
def
LookupView
(
SearchView
,
JSONMixin
):
class
LookupView
(
JSONMixin
,
SearchView
):
model
=
Violation
form_class
=
Search
Form
form_class
=
Search
Violation
#def lookup(request):
# if request.method == 'GET':
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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