##// END OF EJS Templates
Show the list of required tags when non was entered at thread creation
Show the list of required tags when non was entered at thread creation

File last commit:

r1069:389105b1 default
r1099:e990ce46 default
Show More
all_tags.py
22 lines | 540 B | text/x-python | PythonLexer
from django.shortcuts import render
from boards.views.base import BaseBoardView
from boards.models.tag import Tag
PARAM_TAGS = 'all_tags'
PARAM_QUERY = 'query'
class AllTagsView(BaseBoardView):
def get(self, request, query=None):
params = dict()
if query == 'required':
params[PARAM_TAGS] = Tag.objects.filter(required=True)
else:
params[PARAM_TAGS] = Tag.objects.get_not_empty_tags()
params[PARAM_QUERY] = query
return render(request, 'boards/tags.html', params)