def form_style(self, style): if style.lower() not in ('default', 'inline'): raise FormHelpersException( 'Only default and inline are valid in the \ form_style helper attribute') self._form_style = style.lower()
def form_style(self, style): if style.lower() not in ("default", "inline"): raise FormHelpersException( "Only default and inline are valid in the \ form_style helper attribute") self._form_style = style.lower()
def form_method(self, method): if method.lower() not in ("get", "post"): raise FormHelpersException( "Only GET and POST are valid in the \ form_method helper attribute" ) self._form_method = method.lower()
def _check_layout_and_form(self): self._check_layout() if self.form is None: raise FormHelpersException( "You need to pass a form instance to your FormHelper")
def _check_layout(self): if self.layout is None: raise FormHelpersException( "You need to set a layout in your FormHelper")
def form_method(self, method): if method.lower() not in ('get', 'post'): raise FormHelpersException('Only GET and POST are valid in the \ form_method helper attribute') self._form_method = method.lower()