Beispiel #1
0
 def test_text_area(self):
     eq_(
         textarea("aa", ""),
         u'<textarea id="aa" name="aa"></textarea>'
     )
     eq_(
         textarea("aa", None),
         u'<textarea id="aa" name="aa"></textarea>'
     )
     eq_(
         textarea("aa", "Hello!"),
         u'<textarea id="aa" name="aa">Hello!</textarea>'
     )
Beispiel #2
0
 def textarea(self, name, content="", id=None, **attrs):
     """
     Outputs <textarea> element.
     """
     id = id or name
     val = self.value(name, content)
     return tags.textarea(self.prefix + name, val, id, **attrs) + self.getErrorTag(name)
Beispiel #3
0
    def textarea(self, name, content="", id=None, **attrs):
        """
        Outputs <textarea> element.
        """

        return tags.textarea(name, self.value(name, content),
                             self._get_id(id, name), **attrs)
    def textarea(self, name, content="", id=None, **attrs):
        """
        Outputs <textarea> element.
        """

        return tags.textarea(
            name, 
            self.value(name, content), 
            self._get_id(id, name), 
            **attrs
        )
Beispiel #5
0
 def textarea(
         self, name, content="", id=None,
         cols=10, inner_cols=None, errors=True, **attrs):
     """
     Outputs <textarea> element.
     """
     id = id or name
     if inner_cols:
         attrs = css_add_class(attrs, 'small-%d' % inner_cols)
     result = tags.textarea(name, self.value(name, content), id, **attrs)
     if cols:
         return self.column(name, result, cols, inner_cols, errors=False)
     else:
         return result
Beispiel #6
0
def text_area(name, content='', **options):
    """
    Creates a text input area.

    Options:

    * ``size`` - A string specifying the dimensions of the textarea.

    Example::

        >>> print text_area("Body", '', size="25x10")
        <textarea cols="25" id="Body" name="Body" rows="10"></textarea>
    """
    _update_fa(options, name)
    if 'size' in options:
        options["cols"], options["rows"] = options["size"].split("x")
        del options['size']
    return textarea(name, content=content, **options)
Beispiel #7
0
def text_area(name, content='', **options):
    """
    Creates a text input area.

    Options:

    * ``size`` - A string specifying the dimensions of the textarea.

    Example::

        >>> print text_area("Body", '', size="25x10")
        <textarea cols="25" id="Body" name="Body" rows="10"></textarea>
    """
    _update_fa(options, name)
    if 'size' in options:
        options["cols"], options["rows"] = options["size"].split("x")
        del options['size']
    return textarea(name, content=content, **options)
Beispiel #8
0
 def textarea(self,
              name,
              content="",
              id=None,
              cols=10,
              inner_cols=None,
              errors=True,
              **attrs):
     """
     Outputs <textarea> element.
     """
     id = id or name
     if inner_cols:
         attrs = css_add_class(attrs, 'small-%d' % inner_cols)
     result = tags.textarea(name, self.value(name, content), id, **attrs)
     if cols:
         return self.column(name, result, cols, inner_cols, errors=False)
     else:
         return result
Beispiel #9
0
 def textarea(self, name, content='', id=None, **attrs):
     return tags.textarea(name,
                          self.value(name, content),
                          self._id(id, name),
                          **attrs)
Beispiel #10
0
 def test_text_area_size_string(self):
     eq_(
         textarea("body", "hello world", cols=20, rows=40),
         u'<textarea cols="20" id="body" name="body" rows="40">hello world</textarea>'
     )
Beispiel #11
0
 def textarea(self, name, content="", id=None, **attrs):
     """
     Outputs <textarea> element.
     """
     id = id or name
     return tags.textarea(name, self.value(name, content), id, **attrs)