forked from DGNum/gestioCOF
delete unused class-views
This commit is contained in:
parent
96597aa146
commit
e8fdd083aa
1 changed files with 3 additions and 34 deletions
|
@ -2034,43 +2034,12 @@ class JSONResponseMixin(object):
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
class JSONDetailView(JSONResponseMixin,
|
class JSONDetailView(JSONResponseMixin, BaseDetailView):
|
||||||
BaseDetailView):
|
"""Returns a DetailView that renders a JSON."""
|
||||||
"""
|
|
||||||
Returns a DetailView that renders a JSON
|
|
||||||
"""
|
|
||||||
def render_to_response(self, context):
|
def render_to_response(self, context):
|
||||||
return self.render_to_json_response(context)
|
return self.render_to_json_response(context)
|
||||||
|
|
||||||
class HybridDetailView(JSONResponseMixin,
|
|
||||||
SingleObjectTemplateResponseMixin,
|
|
||||||
BaseDetailView):
|
|
||||||
"""
|
|
||||||
Returns a DetailView as an html page except if a JSON file is requested
|
|
||||||
by the GET method in which case it returns a JSON response.
|
|
||||||
"""
|
|
||||||
def render_to_response(self, context):
|
|
||||||
# Look for a 'format=json' GET argument
|
|
||||||
if self.request.GET.get('format') == 'json':
|
|
||||||
return self.render_to_json_response(context)
|
|
||||||
else:
|
|
||||||
return super(HybridDetailView, self).render_to_response(context)
|
|
||||||
|
|
||||||
|
|
||||||
class HybridListView(JSONResponseMixin,
|
|
||||||
MultipleObjectTemplateResponseMixin,
|
|
||||||
BaseListView):
|
|
||||||
"""
|
|
||||||
Returns a ListView as an html page except if a JSON file is requested
|
|
||||||
by the GET method in which case it returns a JSON response.
|
|
||||||
"""
|
|
||||||
def render_to_response(self, context):
|
|
||||||
# Look for a 'format=json' GET argument
|
|
||||||
if self.request.GET.get('format') == 'json':
|
|
||||||
return self.render_to_json_response(context)
|
|
||||||
else:
|
|
||||||
return super(HybridListView, self).render_to_response(context)
|
|
||||||
|
|
||||||
|
|
||||||
class ObjectResumeStat(JSONDetailView):
|
class ObjectResumeStat(JSONDetailView):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue