Permalink
Browse files

Added ability to product search be vendor name and price.

  • Loading branch information...
1 parent cc52f9c commit 8144ce857bc0e67056b16127b7f430f615cb0b42 @maxolasersquad committed Feb 22, 2014
Showing with 2 additions and 2 deletions.
  1. +1 −1 register/views.py
  2. +1 −1 templates/register/product_search.html
View
@@ -43,6 +43,6 @@ def end_shift(request):
def product_search(request):
search = request.GET['search']
- results = Item.objects.filter(name__contains=search) | Item.objects.select_related('vendor').filter(name__contains=search).order_by('name')
+ results = Item.objects.filter(name__contains=search) | Item.objects.filter(price__contains=search) | Item.objects.filter(vendor__name__contains=search).order_by('name')
context_instance = { 'search': search, 'results': results}
return render(request, 'register/product_search.html', context_instance)
@@ -28,7 +28,7 @@
{% for item in results %}
<tr onclick="Orthosie.input.select_item('{{ item.upc }}')">
<td>{{ item.upc }}</td>
- <td>{{ item.name }}</td>
+ <td>{{ item.vendor.name}} {{ item.name }}</td>
<td>{{ item.scalable }}</td>
<td>{{ item.price }}</td>
</tr>

0 comments on commit 8144ce8

Please sign in to comment.