Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix: Handle collection.objects when it's a partial function #2889

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

Open
026Fatih wants to merge 3 commits into MongoEngine:master
base: master
Choose a base branch
Loading
from 026Fatih:master

Conversation

Copy link

@026Fatih 026Fatih commented Jul 25, 2025

collection.objects can be a partial function. When it is, trying to call in_bulk on it was causing error.

Note: I added explicit type check before calling it, but I can change it to be always called (because query set is callable).

ars02bahadr reacted with thumbs up emoji
Copy link
Collaborator

bagerard commented Sep 2, 2025

Hi, could you clarify in which case collection.objects is a partial and provide a test case ?

Copy link
Author

026Fatih commented Sep 3, 2025
edited
Loading

Hello,
This issue occurs when the custom queryset manager function takes more than two parameters. In that case, it gets wrapped in a partial, as shown in the snippet from mongoengine/queryset/manager.py:

else:
 queryset = partial(self.get_queryset, owner, queryset)

I'll be adding a test case shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /