I have created a custom view.
How can I insert the view into the admin?
For a normal admin class, we can just simply register it to the admin site:
The pattern gets a view, not the result of calling the view, i.e.:
list_urls = patterns('', r'^list/$', self.list_view())
should be
list_urls = patterns('', r'^list/$', self.list_view)
Also, "list_view" (at this stage) is a view like any other. So it will need to return an HttpResponse object.
def list_view(self, request):
return question_list(request)
You're not showing the code for question_list() but I have the suspicion it is not returning an HttpResponse.
P.S.: If you provided the traceback of the "'function' object is not iterable" exception (you're getting this when visiting "list/" ?) there'd be less guesswork.