From d2c133381a8e536ee433e5ab305fc24146c0feb9 Mon Sep 17 00:00:00 2001 From: Julian Rother <julian@jrother.eu> Date: Tue, 23 Feb 2021 21:52:52 +0100 Subject: [PATCH] Made query class configurable --- ldapalchemy/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldapalchemy/model.py b/ldapalchemy/model.py index ddecd7f..0d9ded4 100644 --- a/ldapalchemy/model.py +++ b/ldapalchemy/model.py @@ -102,7 +102,7 @@ class Query(Sequence): def filter_by(self, **kwargs): filter_params = [(getattr(self.__model, attr).name, value) for attr, value in kwargs.items()] - return Query(self.__model, self.__filter_params + filter_params) + return type(self)(self.__model, self.__filter_params + filter_params) class QueryWrapper: def __get__(self, obj, objtype=None): -- GitLab