Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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...
commit 335995e70dbea769f8174bd92fde38abff05031b 1 parent 79bb07d
@katzj katzj authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  pycassa/columnfamilymap.py
View
3  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
Please sign in to comment.
Something went wrong with that request. Please try again.