News for hackers. Stuff that matters.
Re:Django REST framework 3.1 released by the_vincedent on Friday March 06, 2015 @09:33AM (#9157109)
Still no M2M for ModelSerializer..? Guess I'll have to just keep using a ton of shitty hacks.
Re:Django REST framework 3.1 released by tomchristie on Friday March 06, 2015 @09:54AM (#9157220)
Of course you can use many to many fields with ModelSerializer.

I'm not sure what you mean here, but I'd suggest opening an issue if you believe there's a problem - we're pretty comprehensive about dealing with incoming issues.

Re:Django REST framework 3.1 released by the_vincedent on Friday March 06, 2015 @11:22AM (#9157804)
An issue that I've consistently run into is being able to write to related models. I can serialize them just fine, but without being able to write, it forces users to come up with nasty work arounds. To be fair, I hate having to write resources that handle writing nested objects, but there are some many front end use cases where multiple writes is not ideal.
Re:Django REST framework 3.1 released by tomchristie on Friday March 06, 2015 @11:40AM (#9157928)
Oh right, writable nested serializations, sure. I won't rehash the reasons that we don't support that in core (ill defined what behavior the user should expect) but yeah it'd still be good to have a third party package that does a decent "best effort" job of that.

My personal take on this is forget about "shitty hacks" or trying to handle this automatically, and just write the serializer create and update methods explicitly.

Re:Django REST framework 3.1 released by the_vincedent on Friday March 06, 2015 @02:47PM (#9159120)
I know why it's not supported and I agree that there should be a third party package for it that is more or less officially supported/recommended like the jwt package.

Most recently I created a new handler object that runs some introspection of the model. I then override my model view sets' create and update methods to implement the handler. Maybe I should get off my ass and open source it (currently buried in a project).

Re:Django REST framework 3.1 released by wylee on Friday March 06, 2015 @11:10AM (#9157736)
I'm not sure what your use case is, but you may want to look at serializers.RelatedField.