Hi,

For an unknown var, query and post doesn't answer the same. Is there 
a reason for this ?

In [18]: req = Request.blank('')

In [19]: req.queryvars.get('unknown','?')
Out[19]: '?'

In [20]: req.queryvars.get('unknown')    

In [21]: req.postvars.get('unknown','?')
---------------------------------------------------------------------------
exceptions.AttributeError                            Traceback (most recent 
call                                                                last)

/vrac/python/mywsgi/<console> 

AttributeError: 'NoVars' object has no attribute 'get'

In [22]: req.params.get('unknown','?')
---------------------------------------------------------------------------
exceptions.AttributeError                            Traceback (most recent 
call last)

/vrac/python/mywsgi/<console> 

/usr/lib/python2.4/UserDict.py in get(self, key, default)
    156     def get(self, key, default=None):
    157         try:
--> 158             return self[key]
    159         except KeyError:
    160             return default

/vrac/python/mywsgi/webob/multidict.py in __getitem__(self, key)
    407     def __getitem__(self, key):
    408         for d in self.dicts:
--> 409             value = d.get(key, _dummy)
    410             if value is not _dummy:
    411                 return value

AttributeError: 'NoVars' object has no attribute 'get'




-- 
William Dodé  -  http://flibuste.net
Développeur informatique indépendant


_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to