Esempio n. 1
0
    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()
Esempio n. 2
0
    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()
Esempio n. 4
0
 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")
Esempio n. 5
0
 def _check_layout(self):
     if self.layout is None:
         raise FormHelpersException(
             "You need to set a layout in your FormHelper")
Esempio n. 6
0
    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()