Changeset 224
- Timestamp:
- 07/13/06 15:30:03
- Files:
-
- trunk/storage/db.py (modified) (4 diffs)
- trunk/units.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/storage/db.py
r223 r224 117 117 def coerce(self, cls, key): 118 118 """coerce(cls, key) -> SQL typename for valuetype.""" 119 valuetype = cls.property _type(key)119 valuetype = cls.property(key).type 120 120 mod = valuetype.__module__ 121 121 if mod == "__builtin__": … … 402 402 def consume(self, unit, key, value, coltype): 403 403 try: 404 expectedType = unit.__class__.property _type(key)404 expectedType = unit.__class__.property(key).type 405 405 value = self.coerce(value, coltype, expectedType) 406 406 unit._properties[key] = value … … 1295 1295 data, columns = self.fetch(sql) 1296 1296 actualTypes = [x[1] for x in columns] 1297 expectedTypes = [cls.property _type(x)for x in fields]1297 expectedTypes = [cls.property(x).type for x in fields] 1298 1298 1299 1299 coerce = self.fromAdapter.coerce … … 1328 1328 data, columns = self.fetch(sql) 1329 1329 actualTypes = [x[1] for x in columns] 1330 expectedTypes = [cls.property _type(x)for x in fields]1330 expectedTypes = [cls.property(x).type for x in fields] 1331 1331 1332 1332 coerce = self.fromAdapter.coerce trunk/units.py
r223 r224 598 598 indices = classmethod(indices) 599 599 600 def property _type(cls, key):601 """ cls.property_type(key) -> type of the given UnitProperty."""600 def property(cls, key): 601 """Return the specified UnitProperty object (not its value).""" 602 602 # Retrieving from the class gives us 603 603 # the UnitProperty object, not its value. 604 return getattr(cls, key) .type605 property _type = classmethod(property_type)604 return getattr(cls, key) 605 property = classmethod(property) 606 606 607 607 def adjust(self, **values):
