Free and open source ticket system written in python
Something went wrong. Try again.
123456789101112131415from django.shortcuts import renderfrom django.views.generic import ListViewfrom .models import Incident
class IncidentListView(ListView): model = Incident
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["existing_incidents"] = Incident.objects.filter(public=True, resolved=False).exists() return context
def get_queryset(self): return Incident.objects.filter(public=True).order_by('resolved')