Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I find it hard to criticize DRF, but one thing that could be added to the documentation is how to deal with M2M. Last time I tried a few different ways of doing it, and only two of them worked, then I had to figure out which way is better.

Also, https://www.cdrf.co/ helps with the class inheritance tree.



Which is obviously inspired by https://ccbv.co.uk/ which helps with the normal django class based views.

It really helped me find my way around the inheritance tree as well.


I don't think http://django-vanilla-views.org/ ever really caught on, but it does show that ccbv.co.uk shouldn't have to exist. The DRF class tree is small enough to keep in your head once you've spent some time with it.


I honestly only managed to get my mind wrapped around how class based views worked by studying Django Vanilla Views and Django Rest Framework… while I eventually learned and understood why the built in class based views are the way they are… in no small part thanks to https://ccbv.co.uk/ … but it was definitely more instructive to have a more simple class and mixin hierarchy that I could use, put breakpoints on, and fully get my head at… in order to get my mind around the very concept of class based views … after that it all made a lot more sense.


The class inheritance tree problem is solvable with a proper IDE/editor setup that allows you to drill-down into implementations. In a properly configured PyCharm for example you can Cmd+Click on any symbol and see its implementation (and do so recursively).


Not too long ago I finally ditched vscode for webstorm for my day to day work, and it's honestly fascinating how much I was missing before.

The fact that you can't even have multiple windows in vscode for say your task output is wild to me.

But Jetbrains refactoring tools is where it shines to me.


They really should add these to the main docs website.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: