From 46a3056c4ebfe78d4cef44374ef2bbf87e5e51bf Mon Sep 17 00:00:00 2001 From: Ofer Koren Date: Thu, 22 Oct 2020 00:05:47 +0300 Subject: [PATCH] collections: use the overridable '._new' when creating a sub-collection via FilteredCollection --- easypy/collections.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easypy/collections.py b/easypy/collections.py index 07c1b4ef..611ce7f5 100644 --- a/easypy/collections.py +++ b/easypy/collections.py @@ -644,8 +644,8 @@ def __init__(self, base, preds, filters, parent=None, name=None): def _new(self, items): if hasattr(self.base, 'ID_ATTRIBUTE'): - return self.base.__class__(items, ID_ATTRIBUTE=self.base.ID_ATTRIBUTE) - return self.base.__class__(items) + return self.base._new(items, ID_ATTRIBUTE=self.base.ID_ATTRIBUTE) + return self.base._new(items) def __repr__(self): if self.name and self.base.name: