# HG changeset patch # User Pawel Solyga # Date 1224695937 0 # Node ID 7cd6bdfbf95c7c10255fb1c686edcfb1fa656900 # Parent 3cf5630d86d1d922aa43a7931d38e1133c7718f7 Inherit from BaseForm in all forms instead of from DbModelForm. This change doesn't include changes to templates and usage of as_table everywhere (work in progress). Patch by: Pawel Solyga Review by: to-be-reviewed diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/docs/edit.py --- a/app/soc/views/docs/edit.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/docs/edit.py Wed Oct 22 17:18:57 2008 +0000 @@ -84,7 +84,7 @@ return doc -class CreateForm(helper.forms.DbModelForm): +class CreateForm(helper.forms.BaseForm): """Django form displayed when Developer creates a Document. """ content = forms.fields.CharField(widget=helper.widgets.TinyMCE( diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/helper/widgets.py --- a/app/soc/views/helper/widgets.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/helper/widgets.py Wed Oct 22 17:18:57 2008 +0000 @@ -52,7 +52,7 @@ dictionary You can set TinyMCE widget for particular form field using code below: - class ExampleForm(helper.forms.DbModelForm): + class ExampleForm(helper.forms.BaseForm): content = forms.fields.CharField(widget=helper.widgets.TinyMCE()) You can include tiny_mce_src.js in your template using: diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/models/docs.py --- a/app/soc/views/models/docs.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/models/docs.py Wed Oct 22 17:18:57 2008 +0000 @@ -40,7 +40,7 @@ import soc.views.helper import soc.views.helper.widgets -class CreateForm(helper.forms.DbModelForm): +class CreateForm(helper.forms.BaseForm): """Django form displayed when Developer creates a Document. """ diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/models/host.py --- a/app/soc/views/models/host.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/models/host.py Wed Oct 22 17:18:57 2008 +0000 @@ -40,7 +40,7 @@ import soc.views.helper.widgets -class CreateForm(helper.forms.DbModelForm): +class CreateForm(helper.forms.BaseForm): """Django form displayed when creating a Host. """ diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/models/sponsor.py --- a/app/soc/views/models/sponsor.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/models/sponsor.py Wed Oct 22 17:18:57 2008 +0000 @@ -42,7 +42,7 @@ import soc.views.helper.widgets -class CreateForm(helper.forms.DbModelForm): +class CreateForm(helper.forms.BaseForm): """Django form displayed when creating a Sponsor. """ class Meta: diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/person/profile.py --- a/app/soc/views/person/profile.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/person/profile.py Wed Oct 22 17:18:57 2008 +0000 @@ -40,7 +40,7 @@ import soc.views.helper.forms -class EditForm(helper.forms.DbModelForm): +class EditForm(helper.forms.BaseForm): """Django form displayed when creating or editing a Person. """ diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/settings.py --- a/app/soc/views/settings.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/settings.py Wed Oct 22 17:18:57 2008 +0000 @@ -48,7 +48,7 @@ import soc.views.out_of_band -class SettingsValidationForm(helper.forms.DbModelForm): +class SettingsValidationForm(helper.forms.BaseForm): """Django form displayed when creating or editing Settings. This form includes validation functions for Settings fields. @@ -81,7 +81,7 @@ exclude = ['inheritance_line', 'home'] -class DocSelectForm(helper.forms.DbModelForm): +class DocSelectForm(helper.forms.BaseForm): """Django form displayed to select a Document. """ diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/site/sponsor/profile.py --- a/app/soc/views/site/sponsor/profile.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/site/sponsor/profile.py Wed Oct 22 17:18:57 2008 +0000 @@ -46,7 +46,7 @@ import soc.views.out_of_band -class CreateForm(helper.forms.DbModelForm): +class CreateForm(helper.forms.BaseForm): """Django form displayed when creating a Sponsor. """ class Meta: diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/site/user/profile.py --- a/app/soc/views/site/user/profile.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/site/user/profile.py Wed Oct 22 17:18:57 2008 +0000 @@ -46,7 +46,7 @@ import soc.views.helper.responses -class LookupForm(helper.forms.DbModelForm): +class LookupForm(helper.forms.BaseForm): """Django form displayed for a Developer to look up a User. This form is manually specified, instead of using @@ -199,7 +199,7 @@ return helper.responses.respond(request, template, context) -class EditForm(helper.forms.DbModelForm): +class EditForm(helper.forms.BaseForm): """Django form displayed when Developer edits a User. This form is manually specified, instead of using @@ -360,7 +360,7 @@ return helper.responses.respond(request, template, context) -class CreateForm(helper.forms.DbModelForm): +class CreateForm(helper.forms.BaseForm): """Django form displayed when Developer creates a User. This form is manually specified, instead of using diff -r 3cf5630d86d1 -r 7cd6bdfbf95c app/soc/views/user/profile.py --- a/app/soc/views/user/profile.py Wed Oct 22 17:03:08 2008 +0000 +++ b/app/soc/views/user/profile.py Wed Oct 22 17:18:57 2008 +0000 @@ -43,7 +43,7 @@ import soc.views.helper.responses -class UserForm(helper.forms.DbModelForm): +class UserForm(helper.forms.BaseForm): """Django form displayed when creating or editing a User. """ class Meta: