added TagSearch class but not using it atm
This commit is contained in:
parent
8da96e27a5
commit
8ae45354f0
@ -11,7 +11,22 @@
|
||||
</ul>
|
||||
</div>
|
||||
{% include "taggit_templatetags2/tagcanvas_include_js_static.html" %}
|
||||
{% include_tagcanvas 'tag-cloud' '200 px' '200 px' 'taggit_templatetags2' 'application.Post' %}
|
||||
|
||||
<div id="tag-cloud">
|
||||
</div>
|
||||
|
||||
<form type="get" action="." style="margin: 0">
|
||||
<input id="search_box" type="text" name="search_box" placeholder="Search..." >
|
||||
<button id="search_submit" type="submit" >Submit</button>
|
||||
</form>
|
||||
<div>
|
||||
<ul>
|
||||
{% for tag in tags %}
|
||||
<li>
|
||||
{{tag}}
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
@ -119,7 +119,27 @@ def student_page(request):
|
||||
return render(request, 'blog_search_list_view.html', {'result':result})
|
||||
|
||||
|
||||
class TagSearch(TagCanvasListView):
|
||||
template_name = 'blog_search_list_view.html'
|
||||
model = Post
|
||||
context_object_name = 'list'
|
||||
paginate_by = 8
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(CustomerSearch, self).get_context_data(**kwargs)
|
||||
context = self.get_queryset()
|
||||
return context
|
||||
|
||||
def get_queryset(self):
|
||||
cObj = Customer.objects.all()
|
||||
var_get_search = self.request.GET.get('search_box')
|
||||
|
||||
if var_get_search is not None:
|
||||
cObj = cObj.filter(firstname__icontains=var_get_search)
|
||||
if var_get_order_by is not None:
|
||||
cObj = cObj.order_by(var_get_order_by)
|
||||
return cObj
|
||||
|
||||
def blog_search_list_view(request):
|
||||
return render(request, 'blog_search_list_view.html', {})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user