[Web-SIG] Random thoughts
John J Lee
jjl at pobox.com
Mon Nov 3 13:23:51 EST 2003
On Mon, 3 Nov 2003, Ian Bicking wrote:
[...]
> Seems a little long-winded. How about request.formdata, .postdata,
> .querydata, where .formdata is postdata+querydata? (In practice most
> people use the combined version)
+1
> They could be proper dictionary-like objects. Though if they aren't
> real dictionaries, I suppose we would have:
>
> request.fields, request.fields.post, request.fields.query, each of
> which implements a dictionary interface.
[...]
Why does the dictionary-ness of these objects force moving them from
attributes of request into attributes of a fields object? I don't like
__getitem__, but I like breaking the "law of demeter" less. If people
prefer to avoid __getitem__, they could just be methods: .formdata(),
.querydata(), .postdata() (or use the new descriptor stuff? I know
nothing about that...).
John
More information about the Web-SIG
mailing list