[Twisted-Python] twisted web, documentation
Donovan Preston
dp at twistedmatrix.com
Fri Apr 25 13:42:34 MDT 2003
On Friday, April 25, 2003, at 12:16 PM, Peter Hansen wrote:
> William Dode wrote:
>>
>> class ReportRequest(twisted.web.resource.Resource):
>> """ ReportRequest with forms and cookies """
>> def render(self, request):
>> session = request.getSession()
>>
>> try:
>> if request.args["text"]!="":
>> session.text = request.args["text"]
>
> Please correct me if I'm wrong, or out of date, but doesn't
> request.args
> contain *lists* of things, always, and not the strings directly? That
> was what I observed on 1.0.3 anyway, I thought.
>
> If that's so, then I think the above test will always pass, as
> request.args['text'] would contain [''] or [] or something, but
> never just "".
That is correct. request.args always contains lists.
Donovan
More information about the Twisted-Python
mailing list