Bennyland this server is running in my bedroom – benny’s learning how to run a linux server

17Mar/100

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...

11Feb/100

I’m learning Python

As the subject of this post suggests, I'm learning python. I was going to go out to the local bookstore today to buy a book on python (I normally just try to learn things on my own, but I'm unfortunately in a bit of a hurry and am finding it difficult to find useful tutorials online) but it turned out I didn't need to. Dive Into Python is available free online, or in book form, as well as Python for Software Design - How to Think Like a Computer Scientist I'm midway through chapter 3 in Dive... and my inability to stay focused has caused me to write this post.

I love free :)

Yesterday I hooked up a post-commit script in my svn repository that automatically publishes the python code I'm currently trying to write. It's pretty cool as it allows you to source control your web(site/apps) I'll post later on how to do such a thing.

Tagged as: , No Comments