def search(request): form = SearchForm(request.POST) books = models.Book.objects.filter(title=form.data['title']) res = render(request, 'BRMapp/searchbook.html', { 'form': form, 'books': books }) return res
def search(request): form = SearchForm(request.POST) products = models.Product.objects.filter( title__startswith=form.data['title']) #products=models.Product.objects.filter(company__startswith=form.data['company']) #products=models.Product.objects.filter(distributer__startswith=form.data['distributer']) #products=models.Product.objects.filter(title=form.data['title']) res = render(request, 'BRMapp/search_product.html', { 'form': form, 'products': products }) return res
def searchBook(request): try: username = request.session['username'] except: return HttpResponseRedirect('login') else: form = SearchForm() res = render(request, 'BRMapp/search_book.html', { 'form': form, 'username': username }) return res
def search(request): try: username = request.session['username'] except: return HttpResponseRedirect('login') else: x = 0 form = SearchForm(request.POST) books = models.Book.objects.filter(title=form.data['title']) if len(books) == 0: x = 1 res = render(request, 'BRMapp/search_book.html', { "books": books, "form": form, "x": x, 'username': username }) return res
def searchBook(request): form=SearchForm() return render(request,'BRMapp/search_book.html',{'form':form})
def search(request): form=SearchForm(request.POST) username=request.session['username'] books=models.Book.objects.filter(title=form.data['title']) res=render(request,'BRMapp/search-book.html',{'form':form,'books':books,'username':username}) return res
def searchBook(request): form=SearchForm() username=request.session['username'] res=render(request,'BRMapp/search-book.html',{'form':form,'username':username}) return res
def searchProduct(request): form = SearchForm() res = render(request, 'BRMapp/search_product.html', {'form': form}) return res
def searchBook(request): # only displays the search form form = SearchForm() res = render(request, 'BRMapp/search_book.html', {'form': form}) return res
def search(request): form = SearchForm(request.POST) books = models.Book.objects.filter(title=form.data['title'])