Re: [Webware-devel] Processing POST and GET fields in wsgikit

2004-12-08 Thread Ian Bicking
Eric Radman wrote:
One of my applications is failing under wsgikit because it requires
input from both both POST and GET variables in the fields dictionary.
This is the test I'm using:
from wsgikit.webkit.wkservlet import Page
class test(Page):
def writeBodyParts(self):
self.writeln("""Request Method: %s""" %  self.request().method())
self.writeln("""   """)
self.writeln("""Field variables:""")
self.writeln("")
fields = self.request().fields()
for field in fields:
self.writeln("%s : %s" % (field, fields[field]))
self.writeln("")
Under Webware the fields dictionary contains the values from the query
string as well as the POST content. Webware overloads cgi.FieldStorage()
and creates a new class that explicitly parses the query string even if
the HTTP request type was not GET.
I tried to copy this from Webware... or at least I thought I did.  I 
think I couldn't figure out what the FieldStorage subclass was doing, so 
I ended up deleting it after I put it in.

It's unclear to me how this should be implemented, but I assume it has
to tie into the HTTPRequest._setupFields() function in wkrequest.py
I just checked in a change to that method that should do it, though I 
haven't tested it.  I think the overloaded FieldStorage in WebUtils is 
unnecessary -- but maybe that's because older cgi.py's didn't have a 
public parse_qs() function?

I really should have unit tests.  The positive part is that it should be 
really easy to implement tests; creating and executing fake WSGI 
requests is really easy.  I'll try to work on that soon.

--
Ian Bicking  /  [EMAIL PROTECTED]  /  http://blog.ianbicking.org
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel


[Webware-devel] release status

2004-12-08 Thread Mark Phillips
I have been down with the flu for the past six days. I think I am 
recovering, but then I thought that on Sunday... I have to postpone 
work on the Webware release until next week so I have time to catch up 
on contract work.

Mark Phillips
Mophilly & Associates
On the web at http://www.mophilly.com
On the phone at 619 444-9210

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel


[Webware-devel] Processing POST and GET fields in wsgikit

2004-12-08 Thread Eric Radman
One of my applications is failing under wsgikit because it requires
input from both both POST and GET variables in the fields dictionary.

This is the test I'm using:

from wsgikit.webkit.wkservlet import Page

class test(Page):
def writeBodyParts(self):
self.writeln("""Request Method: %s""" %  self.request().method())
self.writeln("""   """)
self.writeln("""Field variables:""")
self.writeln("")
fields = self.request().fields()
for field in fields:
self.writeln("%s : %s" % (field, fields[field]))
self.writeln("")

Under Webware the fields dictionary contains the values from the query
string as well as the POST content. Webware overloads cgi.FieldStorage()
and creates a new class that explicitly parses the query string even if
the HTTP request type was not GET.

It's unclear to me how this should be implemented, but I assume it has
to tie into the HTTPRequest._setupFields() function in wkrequest.py

-- 
Eric Radman  |  http://eradman.com


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel