On Sunday, October 16, 2016 at 12:35:03 AM UTC+1, adam.d....@gmail.com
> I spent the better part of the day going through this example and found
> what I think is an oversight that might be worth updating. There is no
> mention that when you switch to generic class-based views that the url
> patterns needs to update from url(r'^snippets/(?P<id>[0-9]+)/$', views.
> SnippetDetail.as_view()), *TO* url(r'^snippets/(?P<pk>[0-9]+)/$', views.
> SnippetDetail.as_view()).I hope this can help someone.
As an alternative you can add a field lookup_field to the SnippetDetail
view class with the value "id"
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.