示例#1
0
    def begin(self, url=None, **attrs):
        """
        Creates the opening <form> tags.

        By default URL will be current path.
        """
        url = url or self.form.request.path
        multipart = attrs.pop('multipart', self.form.multipart)
        return tags.form(url, multipart=multipart, **attrs)
示例#2
0
 def begin(self, url=None, skip_csrf=False, **attrs):
     """
     Return a ``form`` opening tag.
     """
     url = url or self.form.request.path
     multipart = attrs.pop('multipart', self.form.multipart)
     tag = tags.form(url, multipart=multipart, **attrs)
     if not (self.form.skip_csrf or skip_csrf):
         tag += self.csrf_token()
     return tag
示例#3
0
 def begin(self):
     attr = self.element.get_attrs()
     action = attr.pop('action', '')
     self.output.inc(tags.form(action, **attr))
示例#4
0
 def begin(self, url=None, **attrs):
     """
     Creates the opening <form> tag
     """
     return tags.form(url, **attrs)