Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tag_filter(request, tag):
- now = datetime.datetime.now()
- concerts = Concert.objects.filter(tags__name__in=[tag])
- .filter(date__gte=now).order_by('date')
- return render(request, 'concerts/calendar.html', {'concerts': concerts})
- {% elif request.resolver_match.url_name == "tag_filter" %}
- <h1>Upcoming Events with "{{ concerts.0.tags.name }}" Tag</h1>
- {% endif %}
Add Comment
Please, Sign In to add comment