def edit_search(request): q = request.GET.get('q', '') if q == '': return HttpResponseRedirect("/") snapshot = working_snapshot() return render( request, 'law/edit_search.html', dict(charges=Charge.objects.filter(snapshot=snapshot, label__icontains=q)))
def snapshot(self): return working_snapshot()
def get_context_data(self, *args, **kwargs): return dict(snapshots=Snapshot.objects.all(), working_snapshot=working_snapshot(), public_snapshot=public_snapshot())