Hallo,
I have a Form in which I have define some checkbox input.
<form name="inform" action="/inform/" method="POST">
<input type="checkbox" name="status" value="starting"> starting
<input type="checkbox" name="status" value="waiting"> waiting
<input type="checkbox" name="status" value="accepted"> accepted
<input type="checkbox" name="status" value="failed"> failed
<input type="checkbox" name="status" value="completed" checked>
completed
<input type="submit" name="submit" value="Submit">
<br>
</form>
And I want to get the checkbox values in a list, therefor I use of the
next statement in defined view function inform:
message = request.POST.getlist('status')
def inform(request, page=0):
page = int(page)
message = request.POST.getlist('status')
q_list = ObjectPaginator(Queue.objects.filter(status=message), 20)
has_previous = q_list.has_previous_page(page)
has_next = q_list.has_next_page(page)
return render_to_response(
'queues/inform.html', {'q_list': q_list.get_page(page),
'has_previous': has_previous,
'previous_page' : page -1,
'has_next': has_next,
'next_page': page + 1,
'message': message,}
If I submit this Form, I get the next error:
ProgrammingError at /opvragen/
(1064, "You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '))' at line 1")
)
I think this error is because of filter argument. Maybe I can't give a
list as an argument to the 'filter' function.
If this is the case would you like to tell me how I can solve this
problem?
Regards,
Nader
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---