diff --git a/franklincce/explorer/models.py b/franklincce/explorer/models.py
index 6bdbfa5..a06f2dc 100644
--- a/franklincce/explorer/models.py
+++ b/franklincce/explorer/models.py
@@ -201,4 +201,6 @@ class LegislationClassification(models.Model):
def get_absolute_url(self):
our_name = __class__.__name__
- return reverse("{}.detail".format(our_name), kwargs={"model_id": self.id})
\ No newline at end of file
+ return reverse("{}.detail".format(our_name), kwargs={"model_id": self.id})
+
+models_in_index = [LegislationClassification, School, Country, Sponsor]
\ No newline at end of file
diff --git a/franklincce/explorer/templates/explorer/by_group.html b/franklincce/explorer/templates/explorer/by_group.html
index 7a79121..8e4992f 100644
--- a/franklincce/explorer/templates/explorer/by_group.html
+++ b/franklincce/explorer/templates/explorer/by_group.html
@@ -7,10 +7,9 @@
View legislation
{% endblock content %}
\ No newline at end of file
diff --git a/franklincce/explorer/urls.py b/franklincce/explorer/urls.py
index c334dba..d02a913 100644
--- a/franklincce/explorer/urls.py
+++ b/franklincce/explorer/urls.py
@@ -18,5 +18,5 @@ urlpatterns = [
path("schools/", views.get_all_schools, name="School"),
path("countries/", views.get_all_countries, name="Country"),
path("groups/", views.return_groups, name="Groups"),
- path("sponsors/", views.get_all_sponsors, name="Sponsors")
+ path("sponsors/", views.get_all_sponsors, name="Sponsor")
]
diff --git a/franklincce/explorer/views.py b/franklincce/explorer/views.py
index f468e39..46aa244 100644
--- a/franklincce/explorer/views.py
+++ b/franklincce/explorer/views.py
@@ -1,4 +1,5 @@
from django.shortcuts import get_object_or_404, render
+from django.urls import reverse
from django.http import HttpResponse
from .models import (
@@ -7,7 +8,8 @@ from .models import (
LegislationClassification,
School,
Country,
- Sponsor
+ Sponsor,
+ models_in_index,
)
from random import sample
@@ -115,7 +117,17 @@ def get_all_xs(model):
return wrapper
def return_groups(request):
- return render(request, "explorer/by_group.html", {})
+ listing = {}
+ for model in models_in_index:
+ try:
+ name = model._meta.verbose_name.lower()
+ except:
+ name = model.__name__.lower()
+
+ listing[name] = reverse(model.__name__)
+
+ print(listing)
+ return render(request, "explorer/by_group.html", { "listing": listing })
get_all_by_school = get_all_by_x(School)
get_all_by_country = get_all_by_x(Country)