harvard-lil/shlvme — pull request #3 by imakewebthings (2012-03-27 12:53:51+00:00)
Title: Shelf (part 1)

I think the commit messages on this one mostly speak for themselves. The add shelf form is hooked up now. And the shelf page itself is barley started, though not rendering anything yet besides the shelf title.

I changed the model for Shelf to include `slug`, which represents the pretty urlization of the name. You shouldn't ever have to set it manually, it's derived from `name` on save. The slug is what needs to be used in the url matches. I haven't finished translating any of the current shelf api code over to using it, but it's part of what I'll be doing tomorrow.

This process of making the model change brings up a problem that we'll need to consider. Django doesn't have migrations out of the box the way Rails does, so right now making a change to the models requires manually running some SQL to alter the tables as necessary. I couldn't tell you the exact line to run for the slug change because I actually just dropped all the tables and reran sync + fixture loading. We'll probably want to add a migration library to the project to make future changes smoother. [South](http://south.aeracode.org/) looks to be the most popular by my quick searches. This may or may not require redefining the current models as migrations, I'm not sure. Haven't had time to dig into it too deep. But something to consider in the near term.