Hi, I need to make query like this:
WHERE Comment like '%ev% 3628%' or Comment like '%ew% 3628%'
the number '3628' is a parametr. So I've tried in my view:
First try:
wherestr = "Comment like '%%ev%% %s%%' or Comment like '%%ew%% %s%%'" % (rev_number, rev_number)
comment_o = Issuecomments.objects.extra(where=[wherestr])
but I've got:
TypeError at /comments_by_rev/3628/
not enough arguments for format string
Request Method: GET Request URL: http://127.0.0.1:8001/comments%5Fby%5Frev/3628/ Exception Type: TypeError Exception Value:
not enough arguments for format string
Second try:
comment = IssuetrackerIssuecomments.objects.filter(Q(comment__contains=rev_number), Q(comment__contains='ew') | Q(comment__contains='ev'))
but its not excactly the same.
Have you people of wisdom any idea how to accomplish this?