Esempio n. 1
0
    def hidden_tag_without(self, *exclude_fields):
        """ Return the hidden fields for this form, excluding the fields listed in
            `exclude_fields`

            We use this to render all the hidden fields in the form except for the
            CSRF token, for reasons which are currently unclear to me.
        """
        fields = [
            getattr(self, f) if isinstance(f, string_types) else f
            for f in exclude_fields
        ]
        keep_fields = [
            f for f in self
            if isinstance(f.widget, HiddenInput) and f not in fields
        ]
        return FlaskForm.hidden_tag(self, *keep_fields)
Esempio n. 2
0
 def hidden_tag(self, *args, **kwargs):
     self.form_name.data = self._form_name
     return FlaskForm.hidden_tag(self, *args, **kwargs)