[twill] select form fields - AttributeError: 'int' object has no attribute 'startswith'

Nat Williams nat.williams at gmail.com
Mon May 3 07:31:07 PDT 2010


On Mon, May 3, 2010 at 9:18 AM, Norman Khine <norman at khine.net> wrote:

> hello,
> how do i insert select form fields:
>
> here is my form:
>
> http://paste.lisp.org/display/98712
>
> this works for me
>
> fv("1", "firstName", "Test")
> fv("1", "lastName", "Tester")
> fv("1", "mail", "twill at domain.com")
> fv("1", "confirmMail", "twill at domain.com")
>
> submit()
> code("200")
>
> but when i add
>
> fv("1", "birthday[month]", 3)
>
> i get this error
>
> ==> at http://aqoon.local/fr/registerUser
> Traceback (most recent call last):
>  File "test.py", line 82, in <module>
>    fv("1", "birthday[month]", 3)
>  File
> "/Users/khinester/lib/python2.6/site-packages/twill-0.9-py2.6.egg/twill/commands.py",
> line 450, in formvalue
>    set_form_control_value(control, value)
>  File
> "/Users/khinester/lib/python2.6/site-packages/twill-0.9-py2.6.egg/twill/utils.py",
> line 172, in set_form_control_value
>    if val.startswith('-'):
> AttributeError: 'int' object has no attribute 'startswith'
>
> thanks
>
> --
> ¿noʎ uɐɔ uʍop ǝpısdn ǝʇıɹʍ uɐɔ ı - %>>> "".join( [
> {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for c in
> ",adym,*)&uzq^zqf" ] )
>
>
Try making the value a string instead of an int:

fv("1", "birthday[month]", '3')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/twill/attachments/20100503/451cb9c7/attachment.htm>


More information about the twill mailing list