2024-06-19 05:41:13 -05:00
|
|
|
from django.shortcuts import get_object_or_404, render
|
|
|
|
from django.http import HttpResponse
|
2024-06-19 01:29:05 -05:00
|
|
|
|
2024-06-19 05:41:13 -05:00
|
|
|
from .models import LegislativeText, LegislationBook
|
|
|
|
|
|
|
|
def index(request):
|
2024-06-19 12:41:41 -05:00
|
|
|
legislative_texts = LegislativeText.objects.all()
|
2024-06-19 05:41:13 -05:00
|
|
|
context = {
|
|
|
|
"legislative_texts": legislative_texts,
|
|
|
|
}
|
|
|
|
return render(request, "explorer/index.html", context)
|
|
|
|
|
|
|
|
def view_legislation(request, legislation_id):
|
|
|
|
legislation = get_object_or_404(LegislativeText, pk=legislation_id)
|
|
|
|
context = {
|
|
|
|
"legislation": legislation,
|
|
|
|
}
|
|
|
|
return render(request, "explorer/legislation.html", context)
|