diff --git a/src/sambal/resources/container.py b/src/sambal/resources/container.py index f35b315..3ebade9 100644 --- a/src/sambal/resources/container.py +++ b/src/sambal/resources/container.py @@ -1,5 +1,5 @@ from ldb import SCOPE_ONELEVEL -from samba.domain.models import Container +from samba.domain.models import Container, Model from .resource import Resource @@ -11,14 +11,15 @@ def __init__(self, request, container): super().__init__(request, container) if request.samdb: - queryset = self.model.query( + queryset = Model.query( request.samdb, base_dn=container.dn, scope=SCOPE_ONELEVEL, polymorphic=True, ) + self["children"] = [] for obj in queryset: if obj: resource_class = self.resource_for_model(obj) - self[obj.name] = resource_class(request, obj) + self["children"].append(resource_class(request, obj))