def search(request): **errors = []** if 'q' in request.GET: q = request.GET['q'] if not q: **errors.append('Enter a search term.')** elif len(q) > 20: **errors.append('Please enter at most 20 characters.')** else: books = Book.objects.filter(title__icontains=q) return render_to_response('search_results.html', {'books': books, 'query': q}) return render_to_response('search_form.html', {**'errors': errors** })如上面的代码,为何 被 ** ** 包含的代码是和意义??
- 2 回答
- 0 关注
- 388 浏览
添加回答
举报
0/150
提交
取消