Open marqpdx opened 1 year ago
hi @app-generator :)
I have a model named BookClub
and i ran the generate step and i added my code to the generated api/views.py
file, specifically to the if not pk:
section of the get() method. My new code replaced this:
return Response({
'data': [BookClubSerializer(instance=obj).data for obj in BookClub.objects.all()],
'success': True
}, status=HTTPStatus.OK)
PS, in my code i wouldn't hardcode the value of '2' for the resp.headers['X-Total-Count']
. i am also investigating if there is possibly a decorator to add, or some other way to globally add headers w/o interfering w/ the generated code.
@Mortrest, can you take a look at this case? Ty
I am wanting to use this with React Admin, which requires an 'X-Total-Count' response header. i was able to hard-code it (see below) but i am wondering if there are thoughts about having a config for additional resp. headers we might add?
Thanks!