Changeset 7077
- Timestamp:
- 02/03/12 13:25:36 (4 months ago)
- Files:
-
- trunk/dabo/db/__init__.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/db/__init__.py
r6894 r7077 36 36 from dTable import dTable 37 37 from dDataSet import dDataSet 38 from dabo.dException import FieldNotFoundException 38 39 39 40 daboTypes = { … … 106 107 107 108 def __getitem__(self, key): 108 return self.__getattr__(key) 109 try: 110 val = self.__getattr__(key) 111 except FieldNotFoundException: 112 # __getitem__ added for a dict key-like interface, so convert 113 # the FieldNotFoundException to KeyError. 114 raise KeyError, key 115 return val 109 116 110 117 def __setitem__(self, key, val): 111 return self.__setattr__(key, val) 118 try: 119 return self.__setattr__(key, val) 120 except FieldNotFoundException: 121 # see comment in __getitem__ 122 raise KeyError, key 112 123 113 124 ## The rest of this block adds a property to the Record object
