1) The link to MultiDict here -
http://docs.webob.org/en/latest/reference.html#query-post-variables - is broken. I don't know if any other links are broken but it might be worth checking.
2) I found some docs for it here -
http://readthedocs.org/docs/webob/en/latest/modules/webob.html - but the name (
class webob.multidict.MultiDict) doesn't appear to 'work'.
>>> import webob
>>> x = webob.multidict.Multidict()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Multidict'
>>> import webob.multidict
>>> x = webob.multidict.Multidict()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Multidict'
Either I'm misunderstanding Python packages again - definitely a possibility! - or something is weird and/or wrong here.
3) The docs I found describe it as a normal dictionary, with some extra methods added. If that is the case, then why does a .get() return a KeyError if the item is not in the dictionary? I would expect it to return None.
File "J:\code\pyprojects\pyramid_env\Web2\web2views.py", line 33, in edit_band
band_id = request.POST.get("band_id") # may be 'none'
File "J:\code\pyprojects\pyramid_env\lib\site-packages\webob\multidict.py", line 81, in __getitem__
raise KeyError(key)
KeyError: 'band_id'
That's from a Pyramid app; I couldn't reproduce this with a more bare-bones example because I couldn't work out how to import a Multidict for a simpler test.
--
Ben Sizer