Extending Piston’s BaseHandler for ForeignKey support
Recently I've started working on an API using Django and Piston for an update to our internal timekeeping stuff (something I've been in charge of for most of the time I've been at VV). I quickly ran into a problem with Piston when trying to create or update models that have ForeignKeys in them. As it turns out, Piston does not support ForeignKey. What follows is my attempt at adding this support as well as support for better REST urls that allow for searching and such. I went this route after reading through this post's responses about this very problem.
A note of caution: I've only very recently started learning Python, Django, and Piston - so it's likely that this isn't the best approach... It's also pretty dirty as I'm currently using a combination of rc and {'status':0, 'statusmsg':'message here'} whenever errors happen... what would be better would be to always use rc.SOMETHING and throw errors that get caught and formatted correctly - I just haven't had time to clean this all up just yet...