Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource: fix container resource not including children #42

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

robvdl
Copy link
Member

@robvdl robvdl commented Mar 14, 2024

The issue was that the queryset it was building was based on self.model rather than the base class: Model.

self.model was just Container, so that meant it ended up building a queryset that included only sublcasses of Container which ... is only Container, so it returned no children at all.

Also the super().init(request, container) call populates the Resource dict with data from the base object (the Container), so move the children under a list (using the key "children").

Closes #41

The issue was that the queryset it was building was based on self.model rather than the base class: Model.

self.model was just Container, so that meant it ended up building a queryset that included only sublcasses of Container which ... is only Container, so it returned no children at all.

Also the super().__init__(request, container) call populates the Resource dict with data from the base object (the Container), so move the children under a list (using the key "children").

Closes #41
@robvdl robvdl merged commit aa29ca7 into master Mar 14, 2024
1 check passed
@robvdl robvdl deleted the fix-container-resource branch March 14, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ContainerResource is not showing it's children again
1 participant