编辑:我使用wagtail cms并且我的应用程序基于 models.py:
class index(Page)
def get_context(self, request):
base_tags = ["foo","boo","voo"]
if request.method == "POST" :
tag = request.POST[("id","")]
blogpages = BlogPage.objects.live().filter(tags__name__in=[tag])
return #....
的index.html:
<form id="content" method="post">
<ul class="nav nav-tabs" role="tablist">
{% csrf_token %}
{%for tag in base_tags %}
<li name="id" value="{{tag.id}}" onclick="content.submit();" role="presentation"><a href="#{{tag}}" aria-controls="{{tag}}" role="tab" data-toggle="tab">{{tag}}</a></li>
{% endfor %}
</ul>
</form>
答案 0 :(得分:0)
根本不要在这里使用表格。使用标准链接:
for
并定义您的网址和视图,如下所示:
levels(df$country)[levels(df$country) %in% i] <- "Europe"
...
<ul class="nav nav-tabs" role="tablist">
{% for tag in base_tags %}
<li aria-controls="{{tag}}" role="tab" data-toggle="tab"><a href="{% url "tags" tag %}">{{tag}}</a></li>
{% endfor %}
</ul>