如何找到值列表的id
以下是我所拥有的:
你知道吗视图.py地址:
group = Groups_By_Dates.objects.filter(date=date)
all_groups = group.values_list('time', flat=True)
time = Groups_By_Dates.objects.get(time=???)
我需要能够找到时间,以便我可以使用它在我的模板为一个网址以后。我怎么能做到呢?你知道吗
我已经试过了,但没用:
{% for grouptime in all_groups %}
<div class="row1">
<a href='{% url "listbygroup" time.id %}'> {{grouptime}}</a>
</div>
<div class="row2">
</div>
{% endfor %}
试试这个
相关问题 更多 >
编程相关推荐