level12 / keg-elements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a base class (or mixin) for working with forms

rsyring opened this issue · comments

Example: https://github.com/level12/gb-h2r/blob/c78156c1b5891f6ee49b42b489e747ffa6a1de0e/how2recycle/libs/views.py#L175

Presumably, they created that as a mixin instead of a base class for the flexibility. We might want to provide both, with the base class using the mixin. If we do that, maybe we should do the same for the GridBase?

@guruofgentoo you up for changing the FormMixin a bit with some of the changes I made here: https://github.com/level12/brecham-marshal/blob/master/marsh/libs/views.py#L37

  • A form_create() makes it easier to override just that functionality, which I found helpful in Marshal.
  • rename the "on" methods so they start with "form_" so that all form mixin functionality that isn't get/post have the same prefix.
  • use "page_title" vs "title" to be more specific?

Yep, I'll get that done here shortly.