diff --git a/poetry.lock b/poetry.lock index d3c5ee46bba9c116dc4ad8d1fa8a15c03445960a..5b460d2e94e7143de17524cb541e7731eb611695 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,13 +2,13 @@ [[package]] name = "asgiref" -version = "3.7.2" +version = "3.8.1" description = "ASGI specs, helper code, and adapters" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "asgiref-3.7.2-py3-none-any.whl", hash = "sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e"}, - {file = "asgiref-3.7.2.tar.gz", hash = "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed"}, + {file = "asgiref-3.8.1-py3-none-any.whl", hash = "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47"}, + {file = "asgiref-3.8.1.tar.gz", hash = "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590"}, ] [package.extras] @@ -35,33 +35,33 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "black" -version = "24.2.0" +version = "24.3.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" files = [ - {file = "black-24.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6981eae48b3b33399c8757036c7f5d48a535b962a7c2310d19361edeef64ce29"}, - {file = "black-24.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d533d5e3259720fdbc1b37444491b024003e012c5173f7d06825a77508085430"}, - {file = "black-24.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61a0391772490ddfb8a693c067df1ef5227257e72b0e4108482b8d41b5aee13f"}, - {file = "black-24.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:992e451b04667116680cb88f63449267c13e1ad134f30087dec8527242e9862a"}, - {file = "black-24.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:163baf4ef40e6897a2a9b83890e59141cc8c2a98f2dda5080dc15c00ee1e62cd"}, - {file = "black-24.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e37c99f89929af50ffaf912454b3e3b47fd64109659026b678c091a4cd450fb2"}, - {file = "black-24.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9de21bafcba9683853f6c96c2d515e364aee631b178eaa5145fc1c61a3cc92"}, - {file = "black-24.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:9db528bccb9e8e20c08e716b3b09c6bdd64da0dd129b11e160bf082d4642ac23"}, - {file = "black-24.2.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d84f29eb3ee44859052073b7636533ec995bd0f64e2fb43aeceefc70090e752b"}, - {file = "black-24.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e08fb9a15c914b81dd734ddd7fb10513016e5ce7e6704bdd5e1251ceee51ac9"}, - {file = "black-24.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:810d445ae6069ce64030c78ff6127cd9cd178a9ac3361435708b907d8a04c693"}, - {file = "black-24.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:ba15742a13de85e9b8f3239c8f807723991fbfae24bad92d34a2b12e81904982"}, - {file = "black-24.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7e53a8c630f71db01b28cd9602a1ada68c937cbf2c333e6ed041390d6968faf4"}, - {file = "black-24.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:93601c2deb321b4bad8f95df408e3fb3943d85012dddb6121336b8e24a0d1218"}, - {file = "black-24.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0057f800de6acc4407fe75bb147b0c2b5cbb7c3ed110d3e5999cd01184d53b0"}, - {file = "black-24.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:faf2ee02e6612577ba0181f4347bcbcf591eb122f7841ae5ba233d12c39dcb4d"}, - {file = "black-24.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:057c3dc602eaa6fdc451069bd027a1b2635028b575a6c3acfd63193ced20d9c8"}, - {file = "black-24.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:08654d0797e65f2423f850fc8e16a0ce50925f9337fb4a4a176a7aa4026e63f8"}, - {file = "black-24.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca610d29415ee1a30a3f30fab7a8f4144e9d34c89a235d81292a1edb2b55f540"}, - {file = "black-24.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:4dd76e9468d5536abd40ffbc7a247f83b2324f0c050556d9c371c2b9a9a95e31"}, - {file = "black-24.2.0-py3-none-any.whl", hash = "sha256:e8a6ae970537e67830776488bca52000eaa37fa63b9988e8c487458d9cd5ace6"}, - {file = "black-24.2.0.tar.gz", hash = "sha256:bce4f25c27c3435e4dace4815bcb2008b87e167e3bf4ee47ccdc5ce906eb4894"}, + {file = "black-24.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395"}, + {file = "black-24.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995"}, + {file = "black-24.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7"}, + {file = "black-24.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0"}, + {file = "black-24.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9"}, + {file = "black-24.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597"}, + {file = "black-24.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d"}, + {file = "black-24.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5"}, + {file = "black-24.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f"}, + {file = "black-24.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11"}, + {file = "black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4"}, + {file = "black-24.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5"}, + {file = "black-24.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837"}, + {file = "black-24.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd"}, + {file = "black-24.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213"}, + {file = "black-24.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959"}, + {file = "black-24.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb"}, + {file = "black-24.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7"}, + {file = "black-24.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7"}, + {file = "black-24.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f"}, + {file = "black-24.3.0-py3-none-any.whl", hash = "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93"}, + {file = "black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f"}, ] [package.dependencies] @@ -408,18 +408,17 @@ python-magic = ">=0.4.22,<1.0.0" [[package]] name = "djangorestframework" -version = "3.14.0" +version = "3.15.1" description = "Web APIs for Django, made easy." optional = false python-versions = ">=3.6" files = [ - {file = "djangorestframework-3.14.0-py3-none-any.whl", hash = "sha256:eb63f58c9f218e1a7d064d17a70751f528ed4e1d35547fdade9aaf4cd103fd08"}, - {file = "djangorestframework-3.14.0.tar.gz", hash = "sha256:579a333e6256b09489cbe0a067e66abe55c6595d8926be6b99423786334350c8"}, + {file = "djangorestframework-3.15.1-py3-none-any.whl", hash = "sha256:3ccc0475bce968608cf30d07fb17d8e52d1d7fc8bfe779c905463200750cbca6"}, + {file = "djangorestframework-3.15.1.tar.gz", hash = "sha256:f88fad74183dfc7144b2756d0d2ac716ea5b4c7c9840995ac3bfd8ec034333c1"}, ] [package.dependencies] django = ">=3.0" -pytz = "*" [[package]] name = "djangorestframework-camel-case" @@ -454,21 +453,6 @@ docs = ["sphinx", "sphinx-rtd-theme"] release = ["bump2version", "twine"] tests = ["black", "django-stubs[compatible-mypy]", "djangorestframework-stubs[compatible-mypy]", "flake8", "fqdn", "idna", "isoduration", "isort", "jsonpointer", "mypy", "pytest", "pytest-django", "rfc3339-validator", "rfc3987", "tox", "types-jsonschema", "uri-template", "webcolors"] -[[package]] -name = "drf-nested-routers" -version = "0.93.5" -description = "Nested resources for the Django Rest Framework" -optional = false -python-versions = ">=3.8" -files = [ - {file = "drf-nested-routers-0.93.5.tar.gz", hash = "sha256:1407565abc7bada37c162c7e11bf214ae71625a17fdec6d9a47a17f4a3627d32"}, - {file = "drf_nested_routers-0.93.5-py2.py3-none-any.whl", hash = "sha256:9a6813554020134a02e62f8c2934b2047717f7da06f8b801752c521e43735c63"}, -] - -[package.dependencies] -Django = ">=3.2" -djangorestframework = ">=3.14.0" - [[package]] name = "drf-spectacular" version = "0.27.1" @@ -512,13 +496,13 @@ doc = ["Sphinx", "sphinx-rtd-theme", "sphinxcontrib-spelling"] [[package]] name = "faker" -version = "24.2.0" +version = "24.3.0" description = "Faker is a Python package that generates fake data for you." optional = false python-versions = ">=3.8" files = [ - {file = "Faker-24.2.0-py3-none-any.whl", hash = "sha256:dce4754921f9fa7e2003c26834093361b8f45072e0f46f172d6ca1234774ecd4"}, - {file = "Faker-24.2.0.tar.gz", hash = "sha256:87d5e7730426e7b36817921679c4eaf3d810cedb8c81194f47adc3df2122ca18"}, + {file = "Faker-24.3.0-py3-none-any.whl", hash = "sha256:9978025e765ba79f8bf6154c9630a9c2b7f9c9b0f175d4ad5e04b19a82a8d8d6"}, + {file = "Faker-24.3.0.tar.gz", hash = "sha256:5fb5aa9749d09971e04a41281ae3ceda9414f683d4810a694f8a8eebb8f9edec"}, ] [package.dependencies] @@ -1343,13 +1327,13 @@ files = [ [[package]] name = "referencing" -version = "0.33.0" +version = "0.34.0" description = "JSON Referencing + Python" optional = false python-versions = ">=3.8" files = [ - {file = "referencing-0.33.0-py3-none-any.whl", hash = "sha256:39240f2ecc770258f28b642dd47fd74bc8b02484de54e1882b74b35ebd779bd5"}, - {file = "referencing-0.33.0.tar.gz", hash = "sha256:c775fedf74bc0f9189c2a3be1c12fd03e8c23f4d371dce795df44e06c5b412f7"}, + {file = "referencing-0.34.0-py3-none-any.whl", hash = "sha256:d53ae300ceddd3169f1ffa9caf2cb7b769e92657e4fafb23d34b93679116dfd4"}, + {file = "referencing-0.34.0.tar.gz", hash = "sha256:5773bd84ef41799a5a8ca72dc34590c041eb01bf9aa02632b4a973fb0181a844"}, ] [package.dependencies] @@ -1618,4 +1602,4 @@ watchdog = ["watchdog (>=2.3)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "3236dd7014887b73f65b7ba47920b71659ecec498a07813cdf5290b1e228c0e3" +content-hash = "00adf341064a9b21d09beb0e6593d3597784e351e841f207de41f960acf51a8d" diff --git a/pyproject.toml b/pyproject.toml index 80d156f29309e25c21c0b0056739bded9aeb1bfe..8d06ecff3b6b27a39cf765850de2fea33c7e9fe5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,6 @@ djangorestframework = "^3.14.0" djangorestframework-camel-case = "^1.4.2" django-versatileimagefield = "^3.0" drf-jsonschema-serializer = "^2.0.0" -drf-nested-routers = "^0.93.4" drf-spectacular = "^0.27.1" gunicorn = "^21.2.0" Pillow = "^10.1.0" diff --git a/steering/settings.py b/steering/settings.py index 80040034304dd53e97662268494bb234cbac1c2f..da71cac577acd53b4bbb2811f3f2cfe85feb4a82 100644 --- a/steering/settings.py +++ b/steering/settings.py @@ -122,7 +122,6 @@ INSTALLED_APPS = ( "program", "versatileimagefield", "rest_framework", - "rest_framework_nested", "django_filters", "django_extensions", "drf_spectacular", @@ -211,11 +210,11 @@ if os.getenv("USE_LDAP_AUTH"): "is_superuser": os.getenv("AUTH_LDAP_USER_FLAGS_BY_GROUP_SUPERUSER"), } -# SITE_URL is used by django-oidc-provider and openid-configuration will break not set correctly PORT = os.getenv("STEERING_PORT") AURA_PROTO = os.getenv("AURA_PROTO", default="http") AURA_HOST = os.getenv("AURA_HOST", default="localhost") +# SITE_URL is used by django-oidc-provider and openid-configuration will break if not set correctly SITE_URL = f"{AURA_PROTO}://{AURA_HOST}:{PORT}" if PORT else f"{AURA_PROTO}://{AURA_HOST}" if AURA_PROTO == "https": diff --git a/steering/urls.py b/steering/urls.py index c284b76ed46c329d2cd18c5ce2f58582d2b17c5b..aeb83d0ef9c08e9a141e1c8afd4827b654b917ca 100644 --- a/steering/urls.py +++ b/steering/urls.py @@ -19,7 +19,7 @@ # from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView -from rest_framework_nested import routers +from rest_framework import routers from django.conf import settings from django.conf.urls.static import static @@ -50,56 +50,26 @@ admin.autodiscover() router = routers.DefaultRouter() router.register(r"users", APIUserViewSet, basename="user") -router.register(r"hosts", APIHostViewSet) -router.register(r"shows", APIShowViewSet) -router.register(r"schedules", APIScheduleViewSet) -router.register(r"timeslots", APITimeSlotViewSet) +router.register(r"hosts", APIHostViewSet, basename="host") +router.register(r"shows", APIShowViewSet, basename="show") +router.register(r"schedules", APIScheduleViewSet, basename="schedule") +router.register(r"timeslots", APITimeSlotViewSet, basename="timeslot") router.register(r"notes", APINoteViewSet, basename="note") -router.register(r"categories", APICategoryViewSet) -router.register(r"topics", APITopicViewSet) -router.register(r"types", APITypeViewSet) -router.register(r"music-focus", APIMusicFocusViewSet) -router.register(r"funding-categories", APIFundingCategoryViewSet) -router.register(r"languages", APILanguageViewSet) -router.register(r"licenses", APILicenseViewSet) -router.register(r"link-types", APILinkTypeViewSet) -router.register(r"rrules", APIRRuleViewSet) +router.register(r"categories", APICategoryViewSet, basename="category") +router.register(r"topics", APITopicViewSet, basename="topic") +router.register(r"types", APITypeViewSet, basename="type") +router.register(r"music-focus", APIMusicFocusViewSet, basename="music-focus") +router.register(r"funding-categories", APIFundingCategoryViewSet, basename="funding-category") +router.register(r"languages", APILanguageViewSet, basename="language") +router.register(r"licenses", APILicenseViewSet, basename="license") +router.register(r"link-types", APILinkTypeViewSet, basename="link-type") +router.register(r"rrules", APIRRuleViewSet, basename="rrule") router.register(r"images", APIImageViewSet, basename="image") -# Nested Routers - -show_router = routers.NestedSimpleRouter(router, r"shows", lookup="show") - -# /shows/1/schedules -show_router.register(r"schedules", APIScheduleViewSet, basename="show-schedules") - -# /shows/1/notes -show_router.register(r"notes", APINoteViewSet, basename="show-notes") - -# /shows/1/timeslots -show_router.register(r"timeslots", APITimeSlotViewSet, basename="show-timeslots") -show_timeslot_router = routers.NestedSimpleRouter(show_router, r"timeslots", lookup="timeslot") - -# /shows/1/timeslots/1/note/ -show_timeslot_router.register(r"note", APINoteViewSet, basename="show-timeslots-note") - -# /shows/1/schedules -schedule_router = routers.NestedSimpleRouter(show_router, r"schedules", lookup="schedule") - -# /shows/1/schedules/1/timeslots -schedule_router.register(r"timeslots", APITimeSlotViewSet, basename="schedule-timeslots") -timeslot_router = routers.NestedSimpleRouter(schedule_router, r"timeslots", lookup="timeslot") - -# /shows/1/schedules/1/timeslots/1/note -timeslot_router.register(r"note", APINoteViewSet, basename="timeslots-note") urlpatterns = [ path("openid/", include("oidc_provider.urls", namespace="oidc_provider")), path("api/v1/", include(router.urls)), - path("api/v1/", include(show_router.urls)), - path("api/v1/", include(show_timeslot_router.urls)), - path("api/v1/", include(schedule_router.urls)), - path("api/v1/", include(timeslot_router.urls)), path("api/v1/playout", json_playout), path("api/v1/program/week", json_playout), path("api/v1/program/<int:year>/<int:month>/<int:day>/", json_day_schedule),