diff options
author | 2022-02-02 00:15:44 +0100 | |
---|---|---|
committer | 2022-02-02 00:15:44 +0100 | |
commit | 09fb2a4df59be324fc41176227ae3c684e2f6add (patch) | |
tree | 9d5baa069f91419e3189115d143129b6dc4b8e31 /pydis_site/apps/resources/urls.py | |
parent | Merge pull request #649 from python-discord/update-pyfakefs (diff) | |
parent | Duck pond removed when removing all filters. (diff) |
Merge pull request #582 from python-discord/swfarnsworth/smarter-resources/merge-with-main
Smarter Resources
Diffstat (limited to 'pydis_site/apps/resources/urls.py')
-rw-r--r-- | pydis_site/apps/resources/urls.py | 20 |
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"), ] |