I've managed to get the toscawidgets 0.1a2dev_r2777 demo running under
pylons 0.9.4.1 (well with minor changes to use myghty). But I've
encountered a weird bug. The POST request from the demo form shows up
as GET on the server side, which cause the @validate to never execute.
Obviously this causes an exception due to nonexistent form_result.
I've verified with ethereal that the browser is actually sending a
POST request to the server, but it shows up as GET in the server
request dict. Here is the TCP stream reassembled by ethereal:
POST /myctrl/save HTTP/1.1
Host: localhost:5000
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/
20070223 Fedora/1.5.0.10-1.fc5 Firefox/1.5.0.10
Accept: text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://localhost:5000/myctrl/srvinfo
Cookie: _session_id=ab3f0a9f5de533988489c53ca48af5f9;
ppp=39007e3b53514b0de7b747867dbd71f5c8ff8d0b5f23b41304168789a83316e9
Content-Type: application/x-www-form-urlencoded
Content-Length: 263
id=I%27m+hidden%21name=Peterage=2email=peter
%40exampledate=2007%2F03%2F17+13%3A02password=password_confirm=address-0.street=address-0.number=address-0.zip_code=address-0.state=NYaddress-1.street=address-1.number=address-1.zip_code=address-1.state=NYHTTP/
1.0 200 OK
Server: PasteWSGIServer/0.5 Python/2.4.3
Date: Sat, 17 Mar 2007 17:25:16 GMT
content-type: text/html; charset=UTF-8
Connection: close
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml; lang=en xml:lang=en
head
titleValidated data/title
/head
body
p
The form widget:
/p
p
pHi, here's the server environment: br/
{'HTTP_REFERER': 'http://localhost:5000/myctrl/srvinfo',
'paste.recursive.forward': lt;paste.recursive.Forwarder from /gt;,
'pylons.routes_dict': {'action': 'save', 'controller': 'myctrl', 'id':
None}, 'toscawidgets.show_apache_config': True,
'paste.recursive.include': lt;paste.recursive.Includer from /gt;,
'SCRIPT_NAME': '', 'paste.parsed_formvars': (MultiDict([('id',
quot;I'm hidden!quot;), ('name', 'Peter'), ('age', '2'), ('email',
'[EMAIL PROTECTED]'), ('date', '2007/03/17 13:02'), ('password', ''),
('password_confirm', ''), ('address-0.street', ''),
('address-0.number', ''), ('address-0.zip_code', ''),
('address-0.state', 'NY'), ('address-1.street', ''),
('address-1.number', ''), ('address-1.zip_code', ''),
('address-1.state', 'NY')]), lt;socket._fileobject object at
0xb09185dc length=263gt;), 'REQUEST_METHOD': 'GET', 'PATH_INFO': '/
myctrl/save', 'SERVER_PROTOCOL': 'HTTP/1.1', 'QUERY_STRING': '',
'paste.throw_errors': True, 'CONTENT_LENGTH': '263',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
1.8.0.10) Gecko/20070223 Fedora/1.5.0.10-1.fc5 Firefox/1.5.0.10',
'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE':
'_session_id=ab3f0a9f5de533988489c53ca48af5f9;
ppp=39007e3b53514b0de7b747867dbd71f5c8ff8d0b5f23b41304168789a83316e9',
'SERVER_NAME': '0.0.0.0', 'REMOTE_ADDR': '127.0.0.1',
'pylons.environ_config': {'cache': 'beaker.cache', 'session':
'beaker.session'}, 'paste.expected_exceptions': [lt;class
paste.httpexceptions.HTTPException at 0xb714ddacgt;],
'wsgi.url_scheme': 'http', 'beaker.cache':
lt;beaker.cache.CacheManager object at 0xb6d43eecgt;,
'paste.config': {'global_conf': {'error_email_from':
'[EMAIL PROTECTED]', '__file__': '/home/vga/330/p2/ppp/development.ini',
'smtp_server': 'localhost', 'here': '/home/vga/330/p2/ppp',
'email_to': '[EMAIL PROTECTED]', 'debug': 'true'}, 'app_conf':
{'sqlalchemy.dburi': 'postgres:///proj2', 'package': 'ppp',
'sqlalchemy.echo': 'true', 'session_secret': 'somesecret',
'cache_dir': '/home/vga/330/p2/ppp/data', 'session_data_dir': '/home/
vga/330/p2/ppp/data/sessions', 'cache_data_dir': '/home/vga/330/p2/ppp/
data/cache', 'session_key': 'ppp'}}, 'wsgiorg.routing_args': ((),
{'action': 'save', 'controller': 'myctrl', 'id': None}),
'SERVER_PORT': '5000', 'toscawidgets.framework':
lt;toscawidgets.mods.pylonshf.PylonsHostFramework object at
0xb08ac5acgt;, 'paste.recursive.script_name': '',
'paste.evalexception': lt;pylons.error.PylonsEvalException object at
0xb6d4b10cgt;, 'wsgi.input': lt;socket._fileobject object at
0xb09185dc length=263gt;, 'HTTP_HOST': 'localhost:5000',
'beaker.session': {'_accessed_time': 1174152316.0575931,
'_creation_time': 1174125342.9964049},
'paste.recursive.include_app_iter':
lt;paste.recursive.IncluderAppIter from /gt;, 'wsgi.multithread':
True, 'paste.httpexceptions':
lt;paste.httpexceptions.HTTPExceptionHandler object at
0xb6d4b0ecgt;, 'HTTP_ACCEPT': 'text/xml,application/xml,application/
xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'wsgi.version': (1, 0), 'paste.registry':