I'm trying to allow a user to upload a 'profile_pic' when they first create their account. What's the best way to go about this using DRF? Here is what I have: https://dpaste.de/9kTq
sjdines joined the channel
sjdines has quit
But it won't allow user to upload image during create(), only for a PUT request
sjdines joined the channel
sjdines has quit
Iwhb4u has quit
sjdines joined the channel
sjdines has quit
sjdines joined the channel
sjdines has quit
odarbelaeze
chris0101 if you're trying to stay RESTful, maybe you should add an endpoint for profile pics
sjdines joined the channel
sjdines has quit
jo_
Koterpillar: I inspected the queryset. If I used an intermediate queryset, there is different SQL produced.
maryokhin has quit
mdemello has quit
sjdines joined the channel
sjdines has quit
If I split that filter(), using an intermediate queryset introduces a LEFT OUTER join which is wrong.
sjdines joined the channel
sjdines has quit
sjdines joined the channel
sjdines has quit
odarbelaeze
chris0101: did you get my point?
sjdines joined the channel
sjdines has quit
vobiscum joined the channel
sjdines joined the channel
sjdines has quit
sjdines joined the channel
sjdines has quit
kenbolton joined the channel
sjdines joined the channel
sjdines has quit
sjdines joined the channel
sjdines has quit
DLSteve has quit
staticshock__
can i prevent model.related_set.all() from generating a join?
sjdines joined the channel
sjdines has quit
bee_keeper has quit
without explicitly using RelatedSet.objects.filter(id=model.id) ?
chris0101
@odarbelaeze: creating it's own model, and then setting up a relationship to user?
sjdines joined the channel
sjdines has quit
sjdines joined the channel
sjdines has quit
ASonOfGod joined the channel
sjdines joined the channel
noobstrap joined the channel
sjdines has quit
staticshock__
wait, my bad. it already does not generate a join. ignore question!
kus joined the channel
subbero joined the channel
subbero has left the channel
vmonteco
Does makemigrations/migrate automatically add all the models from models.py? Or did I forget something and that's the reason why I get a "no such table" error?
odarbelaeze
chris0101: yes, the API doesn't need to ressemble de database exactly, but that's an approach you can make