Commit e0689e88 authored by Sebastien Robin's avatar Sebastien Robin

allow to specify default value with sequence.get


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3889 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 140b31ec
...@@ -78,10 +78,10 @@ class Sequence: ...@@ -78,10 +78,10 @@ class Sequence:
for k, v in kw.items(): for k, v in kw.items():
self._dict[k]=v self._dict[k]=v
def get(self, keyword): def get(self, keyword,default=None):
if self._dict.has_key(keyword): if self._dict.has_key(keyword):
return self._dict[keyword] return self._dict[keyword]
return None return default
class SequenceList: class SequenceList:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment