Closed zvyn closed 4 years ago
I am having the same error trying to follow this cookbook with Python 3.7, Django 3.0 and DRF 3.11. I dont understand why the compatibility matrix says that DRF 3.10 is ok when this change is in DRF 3.9.
As far as I can tell, this change appeared in the documentation of DRF 3.9 but was effective only starting 3.10
Anyway, this has been fixed in release 2.0.7 (https://github.com/drf-forms/drf-schema-adapter/commit/a6c7bc07c62d96fa6680a009f79b9af8359bb93b)
Thanks both of you for the feedback
From the release notes of Django RestFramework and DRF 3.9
announcement they mentioned that
Deprecate the
Router.register
base_name
argument in favor ofbasename
. #5990
Which means, the argument base_name
is no longer available from DRF=3.11
onwards and use basename
instead
So, Change your router config as,
router.register(r'musician', MusicianViewset, basename='musician')
router.register(r'album', AlbumViewset, basename='album')
Thank you, it works now.
Note:just change the base_name -> basename
Currently running ./test.sh fails with the following error:
The reason is this change in the Django REST Framework released in version 3.9.0: "Deprecate the Router.register base_name argument in favor of basename" -- Release Notes
I'd propose the following fix for now:
base_name
andbasename
for drf-schema-adapter routersbase_name
tobasename
when passing kwargs to DRFValueError
when bothbase_name
andbasename
are givenIf that sounds good to you I can try to come up with a patch!