Django weekday catch!
Just a catch in django weekday, its incompalitable with standrad python weekday numbering. You can get weekday in django using Sale.objects.get(sale_date__week_day=2)
or ExtractWeekday
.
Machine Learning | Network Security | Dev Ops
Just a catch in django weekday, its incompalitable with standrad python weekday numbering. You can get weekday in django using Sale.objects.get(sale_date__week_day=2)
or ExtractWeekday
.
Hi,
Hey guys,
The request object will be passed only if DRF constructs the serializer for you, for example when you just pass the serializer_class to a ModelViewSet. But if you are using the Serializer in your custom views, please do remember to pass the request manually, otherwise it won’t work. item_serializer = ItemSerializer(item, context={“request”: request})
This is a short article about django(drf) logging. This are basically what i figureed out while working on a project.
I wanted to upload some json data and a file to on an django api (using drf). But sirprisingly all the solutions pointed to first uploading the file and then send the json in two seprate requests. So this is my note on how i worked it out.
Just testing the waters.