diff --git a/franklincce/explorer/models.py b/franklincce/explorer/models.py index 948e3a2..cd404e4 100644 --- a/franklincce/explorer/models.py +++ b/franklincce/explorer/models.py @@ -135,6 +135,10 @@ class LegislationBook(models.Model): def __str__(self): return "{}".format(self.name) + + def get_absolute_url(self): + our_name = __class__.__name__ + return reverse("{}.detail".format(our_name), kwargs={"model_id": self.id}) class LegislativeText(models.Model): class Meta: @@ -220,4 +224,11 @@ class LegislationClassification(models.Model): our_name = __class__.__name__ return reverse("{}.detail".format(our_name), kwargs={"model_id": self.id}) -models_in_index = [LegislationClassification, School, Country, Sponsor, Category] \ No newline at end of file +models_in_index = [ + LegislationClassification, + School, + Country, + Sponsor, + Category, + LegislationBook +] \ No newline at end of file diff --git a/franklincce/explorer/urls.py b/franklincce/explorer/urls.py index f2182c8..602c5a7 100644 --- a/franklincce/explorer/urls.py +++ b/franklincce/explorer/urls.py @@ -7,7 +7,6 @@ urlpatterns = [ path("all/", views.all, name="all"), path("stats/", views.stats, name="stats"), path("legislation//", views.view_legislation, name="viewleg"), - path("conference//", views.view_conference, name="viewconf"), path("topics//", views.get_all_classified_by_id, name="LegislationClassification.detail"), path("topics/", views.get_all_classifications, name="LegislationClassification"), path("search/", views.handle_search, name="search_legislation"), @@ -17,9 +16,11 @@ urlpatterns = [ path("countries//", views.get_all_by_country, name="Country.detail"), path("sponsors//", views.get_all_by_sponsor, name="Sponsor.detail"), path("categories//", views.get_all_by_category, name="Category.detail"), + path("conference//", views.get_all_by_conference, name="LegislationBook.detail"), 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="Sponsor"), path("categories/", views.get_all_categories, name="Category"), + path("conference/", views.get_all_conferences, name="LegislationBook"), ] diff --git a/franklincce/explorer/views.py b/franklincce/explorer/views.py index 685273c..28c9077 100644 --- a/franklincce/explorer/views.py +++ b/franklincce/explorer/views.py @@ -169,9 +169,11 @@ get_all_by_school = get_all_by_x(School) get_all_by_country = get_all_by_x(Country) get_all_by_sponsor = get_all_by_x(Sponsor) get_all_by_category = get_all_by_x(Category) +get_all_by_conference = get_all_by_x(LegislationBook) get_all_schools = get_all_xs(School) get_all_countries = get_all_xs(Country) get_all_sponsors = get_all_xs(Sponsor) get_all_categories = get_all_xs(Category) -get_all_classifications = get_all_xs(LegislationClassification) \ No newline at end of file +get_all_classifications = get_all_xs(LegislationClassification) +get_all_conferences = get_all_xs(LegislationBook) \ No newline at end of file