class DummyApi(generics.ListCreateAPIView,
viewsets.ViewSet):
"""
get: List all the users.
post: Create a new user.
"""
serializer_class = LogInputSerializer
def get_queryset(self):
return [dict(message='ste'), dict(message='fano')]
def list(self, request, *args, **kwargs):
"""
I'm list
"""
usernames = "stefano"
return Response(usernames)
def create(self, request):
"""
I'm creation
"""
usernames = "stefano"
return Response(usernames)
router = routers.DefaultRouter()
router.register(r'dummy', views.DummyApi, basename='dummy')
urlpatterns = [
path('', include(router.urls)),
path('openapi', get_schema_view(
title=" API",
description="Testing"),
name='openapi-schema')]--
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 to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/c231294a-cfeb-426b-877e-2cfd1cc1dcaf%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CAHn91ofCAmFuoMq2PaouS-9_grUQLq4sBXR6Vd7_yfkG8-WH3Q%40mail.gmail.com.
<Auto Generated Inline Image 1.png>\And OPTION as well<Auto Generated Inline Image 2.png>
I DON'T SEE THE COMMENT OF THE METHODS CREATE AND LISTAND THE SCHEMA URL IGNORES NAMES AND DOCSTRING.
<Auto Generated Inline Image 3.png>
Do you know what I'm missing?
--
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 to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/c231294a-cfeb-426b-877e-2cfd1cc1dcaf%40googlegroups.com.
<Auto Generated Inline Image 1.png><Auto Generated Inline Image 2.png><Auto Generated Inline Image 3.png>