Django REST Framework, pre_save() and serializer.is_valid(), how do they work?
It turned out the problem was that I was using ListAPIView as the base class for my view class and it doesn't have the pre_save method defined. When I added some of the mixins which had it defined everything started working.
Seems weird that something used in a lot of the basic tutorials doesn't support such a basic feature, but live and learn.
I need to attach a user to a request, this seems like a fairly common thing to need to do, but it's turning out to be damn near impossible.
The docs for the Django REST Framework suggest using the pre_save method of the serializer class, which I did, but it doesn't get called when serializer.is_valid() is called, which makes it kind of worthless since without the user field the serializer fails validation.
I've seen a few suggestions but they seem like crazy hacks and/or don't work. Plus, I feel like this is way too common of a task to really need all the stuff I see people suggesting. I can't be the only person to need to attach a user to a object created in a REST request.