SachaG/Telescope — pull request #31 by lyudmil (2012-11-20 15:08:04+00:00)
Title: Towards generic forms

Hey Sacha,

I saw you gave me access to push to the main line, but I figure it's better to review these changes before merging.

What I did was to extract a generic `Model` class and put a bunch of the logic in there. Now `Setting` (and any other model for which we'd like to generate forms) extends `Model` and only defines its blank schema (when there is no data) and overrides the default form options in the constructor using methods defined in `Model`. A lot of the `ModelForm` logic got a lot simpler as well, as you'll be able to see.

Let me know if this is reasonable. There's probably a few refactorings I'd like to push a little further before I'm completely happy with it, but this is a good summary of what I had in my head for generating forms.