render_to index html def open_problems request problems Problem object

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
@render_to("index.html")
def open_problems(request):
problems = Problem.objects.filter(close_date__isnull=False)
if request.method == 'POST':
form = SearchForm(request.POST)
else:
form = SearchForm()
if form.is_valid():
problems = filter(Problem.objects.all(), form)
assert False, problems
return {'problems': problems, 'form': form}