# HG changeset patch # User Pawel Solyga # Date 1228064792 0 # Node ID 492df53e4a0f494623c90f07ed0652fe7e60178b # Parent 6685c7b56d5098a3551b941e57abdcc96ff8ef13 Add missing dots and fix too long line in soc.views.helper.dynaform module. Remove unused imports in soc.views.models.document module. Fix too long lines. Add missing docstring for Meta classes. Patch by: Pawel Solyga diff -r 6685c7b56d50 -r 492df53e4a0f app/soc/views/helper/dynaform.py --- a/app/soc/views/helper/dynaform.py Sun Nov 30 16:46:32 2008 +0000 +++ b/app/soc/views/helper/dynaform.py Sun Nov 30 17:06:32 2008 +0000 @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""This module defines classes and functions for Dynamic Forms +"""This module defines classes and functions for Dynamic Forms. """ __authors__ = [ @@ -28,7 +28,7 @@ class DynaFormMetaclass(djangoforms.ModelFormMetaclass): - """The DynaForm Meta class, adding support for dynamically defined fields + """The DynaForm Meta class, adding support for dynamically defined fields. The new DynaForm class that is created by class function is very similar to one created by the regular djangoforms.ModelFormMetaclass. @@ -66,7 +66,7 @@ def newDynaForm(dynamodel=None, dynabase=None, dynainclude=None, dynaexclude=None, dynafields=None): - """Creates a new form DynaForm class + """Creates a new form DynaForm class. The returned class extends dynabase, but with the following additions: * It has a Meta class with the 'model', 'include', and 'exclude' @@ -98,8 +98,9 @@ return DynaForm -def extendDynaForm(dynaform, dynainclude=None, dynaexclude=None, dynafields=None): - """Extends an existing dynaform +def extendDynaForm(dynaform, dynainclude=None, dynaexclude=None, + dynafields=None): + """Extends an existing dynaform. If any of dynainclude, dynaexclude or dynafields are not present, they are retrieved from dynaform (if present in it's Meta class). diff -r 6685c7b56d50 -r 492df53e4a0f app/soc/views/models/document.py --- a/app/soc/views/models/document.py Sun Nov 30 16:46:32 2008 +0000 +++ b/app/soc/views/models/document.py Sun Nov 30 17:06:32 2008 +0000 @@ -27,12 +27,10 @@ from google.appengine.api import users from django import forms -from django.utils.translation import ugettext_lazy from soc.logic import dicts from soc.logic import validate from soc.views import helper -from soc.views.helper import widgets from soc.views.models import base import soc.models.document @@ -41,6 +39,7 @@ import soc.views.helper import soc.views.helper.widgets + class CreateForm(helper.forms.BaseForm): """Django form displayed when Developer creates a Document. """ @@ -49,6 +48,8 @@ attrs={'rows':10, 'cols':40})) class Meta: + """Inner Meta class that defines some behavior for the form. + """ model = soc.models.document.Document #: list of model fields which will *not* be gathered by the form @@ -76,8 +77,8 @@ doc_key_name = forms.fields.CharField(widget=forms.HiddenInput) created_by = forms.fields.CharField(widget=helper.widgets.ReadOnlyInput(), required=False) - last_modified_by = forms.fields.CharField(widget=helper.widgets.ReadOnlyInput(), - required=False) + last_modified_by = forms.fields.CharField( + widget=helper.widgets.ReadOnlyInput(), required=False) class View(base.View): diff -r 6685c7b56d50 -r 492df53e4a0f app/soc/views/models/request.py --- a/app/soc/views/models/request.py Sun Nov 30 16:46:32 2008 +0000 +++ b/app/soc/views/models/request.py Sun Nov 30 17:06:32 2008 +0000 @@ -50,6 +50,8 @@ """ class Meta: + """Inner Meta class that defines some behavior for the form. + """ model = soc.models.request.Request #: list of model fields which will *not* be gathered by the form diff -r 6685c7b56d50 -r 492df53e4a0f app/soc/views/models/user.py --- a/app/soc/views/models/user.py Sun Nov 30 16:46:32 2008 +0000 +++ b/app/soc/views/models/user.py Sun Nov 30 17:06:32 2008 +0000 @@ -60,6 +60,8 @@ help_text=soc.models.user.User.is_developer.help_text) class Meta: + """Inner Meta class that defines some behavior for the form. + """ model = None def clean_link_id(self):