seantis/seantis-questionnaire — pull request #18 by cgl (2013-09-05 09:59:45+00:00)
Title: Qcache fix

Query using object instance gives TypeError, querying using id from instance solved the problem. Should have been a root cause.

Internal Server Error: /q/f2972b814c910419123254673a9e5312/
Traceback (most recent call last):
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/db/transaction.py", line 223, in inner
return func(*args, **kwargs)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/seantis_questionnaire-2.0-py2.7.egg/questionnaire/views.py", line 319, in questionnaire
return redirect_to_qs(runinfo)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/seantis_questionnaire-2.0-py2.7.egg/questionnaire/views.py", line 235, in redirect_to_qs
if not questionset_satisfies_checks(runinfo.questionset, runinfo):
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/seantis_questionnaire-2.0-py2.7.egg/questionnaire/request_cache.py", line 70, in wrapper
result = func(*args, **kwargs)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/seantis_questionnaire-2.0-py2.7.egg/questionnaire/views.py", line 151, in questionset_satisfies_checks
for q in questionset.questions():
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/seantis_questionnaire-2.0-py2.7.egg/questionnaire/models.py", line 99, in questions
self.__qcache = list(Question.objects.filter(questionset=self).order_by('number'))
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/db/models/manager.py", line 155, in filter
return self.get_query_set().filter(*args, **kwargs)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/db/models/query.py", line 669, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/db/models/query.py", line 687, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1271, in add_q
can_reuse=used_aliases, force_having=force_having)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1202, in add_filter
connector)
File "/Users/cagil/work/virtuals/pdss/lib/python2.7/site-packages/django/db/models/sql/where.py", line 57, in add
value = list(value)
TypeError: 'QuestionSet' object is not iterable