You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a user request for support for MongoEngine. Typing-wise, this seems pretty similar to Django. More details here, but essentially, it looks like models (classes) need some dataclass-like features like a generated __init__ and synthesized fields (id, pk, objects).
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
I think this is great to discuss! At some point when I added factory-boy support, @samwgoldman made a point which is that we've now got special-case logic for Django, Pydantic, Attrs and Marshmallow. Then we added factory-boy. MongoEngine would be six. Each one is individually quite reasonable, but the trend deserves thinking, especially because there will be maintenance cost, I will anticipate there will be versioning issues etc.
Some questions I have:
Who are we unblocking with MongoEngine support?
What's the ongoing cost?
I think that if there is high demand and we can indeed block a large number of users, then perhaps now is also the time to look into a longer-term solution?
Concretely, I know @rchen152 you made some points about investing in our internal architecture for these integrations. Perhaps some kind of API or shared framework for adding and maintaining 3p library support, rather than each one being a bespoke code path?
Today every new library lands as its own special case, which is what makes the maintenance and versioning cost scale linearly with the number of libraries we support. If we can refactor toward a common extension point, the cost of saying "yes" to the next library would be lower and we'd be in a much better position to keep up with version drift.
Agreed, it would be better to design a longer-term solution rather than adding more bespoke code paths. Perhaps MongoEngine support could be a good motivating use case for thinking about how to refactor so that Django and MongoEngine can share the same integration points.
Activity
rchen152 commentedon May 7, 2026
@migeed-z would love to get your thoughts on this
migeed-z commentedon May 9, 2026
I think this is great to discuss! At some point when I added factory-boy support, @samwgoldman made a point which is that we've now got special-case logic for Django, Pydantic, Attrs and Marshmallow. Then we added factory-boy. MongoEngine would be six. Each one is individually quite reasonable, but the trend deserves thinking, especially because there will be maintenance cost, I will anticipate there will be versioning issues etc.
Some questions I have:
I think that if there is high demand and we can indeed block a large number of users, then perhaps now is also the time to look into a longer-term solution?
Concretely, I know @rchen152 you made some points about investing in our internal architecture for these integrations. Perhaps some kind of API or shared framework for adding and maintaining 3p library support, rather than each one being a bespoke code path?
Today every new library lands as its own special case, which is what makes the maintenance and versioning cost scale linearly with the number of libraries we support. If we can refactor toward a common extension point, the cost of saying "yes" to the next library would be lower and we'd be in a much better position to keep up with version drift.
WDYT?
rchen152 commentedon May 12, 2026
Agreed, it would be better to design a longer-term solution rather than adding more bespoke code paths. Perhaps MongoEngine support could be a good motivating use case for thinking about how to refactor so that Django and MongoEngine can share the same integration points.