Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Look at object parents when mapping to column families

Using self.cls.__dict__ only looks at the members of the class and
not any parents.  Better to use inspect.getmembers() for this
purpose and get the full hierarchy
  • Loading branch information...
1 parent 79bb07d commit 335995e70dbea769f8174bd92fde38abff05031b @katzj katzj committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  pycassa/
3  pycassa/
@@ -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.column_validators[name] = val_type

0 comments on commit 335995e

Please sign in to comment.
Something went wrong with that request. Please try again.