Using django rest framework, create a serializer class and specify the
right field you want to display at the end.

Please check this link

https://www.django-rest-framework.org/api-guide/serializers/


On Sun, May 30, 2021 at 10:03 PM Mottaz Hegaze <trapper...@gmail.com> wrote:

> Using Django Rest Framework , you can alter the output by overriting
> function to_represent in serializer.
>
> On Mon, 31 May 2021, 1:26 am Adaeit Telle, <noboda9...@dashseat.com>
> wrote:
>
>> Hi Django Developers,
>> Json response from the django server is huge as the data fields contained
>> are of big size.
>> So, can I restrict the *fields* required in the response data from the
>> *HTTP Request Url* ?
>> Is there a generic param, which can be used ?
>>
>> Just like QuerySet, can we have "ValueSet" to restrict the fields(or
>> columns) in the json response data ?
>>
>> Regards,
>> Adaeit
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f274b86b-e3fb-483b-802e-857362087619n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f274b86b-e3fb-483b-802e-857362087619n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHV4E-dB0%3DHha6HgCoG4igdBbyyjPbQMO3rjkZBPaHH6_Kwscw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHV4E-dB0%3DHha6HgCoG4igdBbyyjPbQMO3rjkZBPaHH6_Kwscw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Oussama Chafiqui

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPvcp%2BUVnw%2BncKDhkOA2dma%3Dd9bw%3DAtgjNy6cCcPZAxnZBVmOA%40mail.gmail.com.

Reply via email to