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
--- 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(
--- 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:
--- 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.
"""
--- 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.
"""
--- 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:
--- 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.
"""
--- 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.
"""
--- 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:
--- 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
--- 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: