Skip to content

Commit a9cc4ce

Browse files
feat!: migrate MongoEngine to native async PyMongo (>= 4.14)
- Refactored the core ORM to support PyMongo’s native async API - Unified sync and async code paths across documents, querysets, and transactions - Replaced legacy async implementations - Removed deprecated and compatibility code BREAKING CHANGE: - Removed legacy async behavior - Removed LazyReferenceField - Removed GenericLazyReferenceField - GenericReferenceField now requires `choices` - Dropped support for PyMongo < 4.14 - Dropped support for MongoDB < 4.2
1 parent 370460d commit a9cc4ce

162 files changed

Lines changed: 37912 additions & 5035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/apireference.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ Fields
9292
.. autoclass:: mongoengine.fields.DictField
9393
.. autoclass:: mongoengine.fields.MapField
9494
.. autoclass:: mongoengine.fields.ReferenceField
95-
.. autoclass:: mongoengine.fields.LazyReferenceField
9695
.. autoclass:: mongoengine.fields.GenericReferenceField
97-
.. autoclass:: mongoengine.fields.GenericLazyReferenceField
9896
.. autoclass:: mongoengine.fields.CachedReferenceField
9997
.. autoclass:: mongoengine.fields.BinaryField
10098
.. autoclass:: mongoengine.fields.FileField

mongoengine/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
# Import submodules so that we can expose their __all__
22
from mongoengine import (
3-
connection,
43
document,
54
errors,
65
fields,
7-
queryset,
86
signals,
97
)
8+
from mongoengine.synchronous import connection
9+
from mongoengine.base import queryset
1010

1111
# Import everything from each submodule so that it can be accessed via
1212
# mongoengine, e.g. instead of `from mongoengine.connection import connect`,
1313
# users can simply use `from mongoengine import connect`, or even
1414
# `from mongoengine import *` and then `connect('testdb')`.
15-
from mongoengine.connection import * # noqa: F401
15+
from mongoengine.synchronous.connection import * # noqa: F401
1616
from mongoengine.document import * # noqa: F401
1717
from mongoengine.errors import * # noqa: F401
1818
from mongoengine.fields import * # noqa: F401
19-
from mongoengine.queryset import * # noqa: F401
2019
from mongoengine.signals import * # noqa: F401
2120

2221
__all__ = (
23-
list(document.__all__)
24-
+ list(fields.__all__)
25-
+ list(connection.__all__)
26-
+ list(queryset.__all__)
27-
+ list(signals.__all__)
28-
+ list(errors.__all__)
22+
list(document.__all__)
23+
+ list(fields.__all__)
24+
+ list(connection.__all__)
25+
+ list(signals.__all__)
26+
+ list(errors.__all__)
2927
)
3028

31-
3229
VERSION = (0, 29, 0)
3330

3431

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .connection import *
2+
from .queryset import *
3+
4+
__all__ = [
5+
list(connection.__all__) +
6+
list(queryset.__all__),
7+
]

0 commit comments

Comments
 (0)