Permalink
Browse files

Merge pull request #181 from katzj/cfmap-objects-inherit

Look at object parents when mapping to column families
  • Loading branch information...
thobbs committed Dec 5, 2012
2 parents 79bb07d + 335995e commit 74a5a32e97831fe0e4994a71fbd11c661cd17fd7
Showing with 2 additions and 1 deletion.
  1. +2 −1 pycassa/columnfamilymap.py
@@ -14,6 +14,7 @@
from pycassa.types import CassandraType
from pycassa.columnfamily import ColumnFamily
import pycassa.util as util
+import inspect
__all__ = ['ColumnFamilyMap']
@@ -51,7 +52,7 @@ def __init__(self, cls, pool, column_family, raw_columns=False, **kwargs):
self.dict_class = util.OrderedDict
self.defaults = {}
self.fields = []
- for name, val_type in self.cls.__dict__.iteritems():
+ for name, val_type in inspect.getmembers(self.cls):
if name != 'key' and isinstance(val_type, CassandraType):
self.fields.append(name)
self.column_validators[name] = val_type

0 comments on commit 74a5a32

Please sign in to comment.