Skip to content

Commit

Permalink
Fix _model_cache inherit seq
Browse files Browse the repository at this point in the history
  • Loading branch information
dchentech committed Aug 1, 2014
1 parent 0b02f66 commit c654bf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion model_cache/model_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ def connect(cls, original_model, **kwargs):
# decorate class
def _model_cache_decorator(decorated_class):
# ensure decorated_class's methods will overwrite ModelCache's.
class _model_cache(decorated_class, ModelCacheClass, default_kwargs['included_class']):
class _model_cache(decorated_class, default_kwargs['included_class'], ModelCacheClass):
class OriginalClass(): pass # so we can setattr here.
original = OriginalClass()
for k1, v1 in default_kwargs.iteritems():
setattr(original, k1, v1)
del k1; del v1
original.model = original_model
_model_cache.__name__ = decorated_class.__name__
_model_cache.__module__ = decorated_class.__module__ # so can pickle :)

dbpath = None
if _model_cache.original.cache_dir:
Expand Down
1 change: 0 additions & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
class OriginalModel(list):
def __init__(self, list1):
super(OriginalModel, self).__init__(list1)
self.__module__ = None

def count(self): return len(self)

Expand Down

0 comments on commit c654bf5

Please sign in to comment.