fix linting + update changelog & contributors
This commit is contained in:
parent
38ebb5abf4
commit
78c9e9745d
1
AUTHORS
1
AUTHORS
@ -256,3 +256,4 @@ that much better:
|
||||
* Eric Timmons (https://github.com/daewok)
|
||||
* Matthew Simpson (https://github.com/mcsimps2)
|
||||
* Leonardo Domingues (https://github.com/leodmgs)
|
||||
* Agustin Barto (https://github.com/abarto)
|
||||
|
@ -21,6 +21,7 @@ Development
|
||||
- ``Queryset._ensure_indexes`` and ``Queryset.ensure_indexes``, the right method to use is ``Document.ensure_indexes``
|
||||
- Added pre-commit #2212
|
||||
- Renamed requirements-lint.txt to requirements-dev.txt #2212
|
||||
- Support for setting ReadConcern #2255
|
||||
|
||||
Changes in 0.19.1
|
||||
=================
|
||||
|
@ -1,7 +1,7 @@
|
||||
from contextlib import contextmanager
|
||||
|
||||
from pymongo.write_concern import WriteConcern
|
||||
from pymongo.read_concern import ReadConcern
|
||||
from pymongo.write_concern import WriteConcern
|
||||
|
||||
from mongoengine.common import _import_class
|
||||
from mongoengine.connection import DEFAULT_CONNECTION_NAME, get_db
|
||||
@ -268,11 +268,11 @@ def set_read_write_concern(collection, write_concerns, read_concerns):
|
||||
combined_write_concerns.update(write_concerns)
|
||||
|
||||
combined_read_concerns = dict(collection.read_concern.document.items())
|
||||
|
||||
|
||||
if read_concerns is not None:
|
||||
combined_read_concerns.update(read_concerns)
|
||||
|
||||
yield collection.with_options(
|
||||
write_concern=WriteConcern(**combined_write_concerns),
|
||||
read_concern=ReadConcern(**combined_read_concerns)
|
||||
read_concern=ReadConcern(**combined_read_concerns),
|
||||
)
|
||||
|
@ -1206,7 +1206,9 @@ class BaseQuerySet:
|
||||
raise TypeError("%r is not a valid read concern." % (read_concern,))
|
||||
|
||||
queryset = self.clone()
|
||||
queryset._read_concern = ReadConcern(**read_concern) if read_concern is not None else None
|
||||
queryset._read_concern = (
|
||||
ReadConcern(**read_concern) if read_concern is not None else None
|
||||
)
|
||||
queryset._cursor_obj = None # we need to re-create the cursor object whenever we apply read_concern
|
||||
return queryset
|
||||
|
||||
|
@ -8,10 +8,10 @@ from mongoengine.context_managers import (
|
||||
no_dereference,
|
||||
no_sub_classes,
|
||||
query_counter,
|
||||
set_read_write_concern,
|
||||
set_write_concern,
|
||||
switch_collection,
|
||||
switch_db,
|
||||
set_write_concern,
|
||||
set_read_write_concern,
|
||||
)
|
||||
from mongoengine.pymongo_support import count_documents
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user