aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources/urls.py
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2022-07-15 13:06:38 +0300
committerGravatar mbaruh <[email protected]>2022-07-15 13:33:21 +0300
commita77f35b598b227d87db0955a0b2bc97839dcb978 (patch)
tree5c2759a37f8dad14d9970e432b698326a86db661 /pydis_site/apps/resources/urls.py
parentAdd UniqueConstraint to the Filter model (diff)
parentMerge pull request #740 from python-discord/update-django (diff)
Merge branch 'main' into new-filter-schema
Diffstat (limited to 'pydis_site/apps/resources/urls.py')
-rw-r--r--pydis_site/apps/resources/urls.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py
index 10eda132..ed24dc99 100644
--- a/pydis_site/apps/resources/urls.py
+++ b/pydis_site/apps/resources/urls.py
@@ -1,25 +1,9 @@
-import typing
-from pathlib import Path
-
from django_distill import distill_path
from pydis_site.apps.resources import views
app_name = "resources"
-
-
-def get_all_resources() -> typing.Iterator[dict[str, str]]:
- """Yield a dict of all resource categories."""
- for category in Path("pydis_site", "apps", "resources", "resources").iterdir():
- yield {"category": category.name}
-
-
urlpatterns = [
- distill_path("", views.ResourcesView.as_view(), name="index"),
- distill_path(
- "<str:category>/",
- views.ResourcesListView.as_view(),
- name="resources",
- distill_func=get_all_resources
- ),
+ distill_path("", views.resources.ResourceView.as_view(), name="index"),
+ distill_path("<resource_type>/", views.resources.ResourceView.as_view(), name="index"),
]