Compare commits
5 Commits
aggregatio
...
simpler-as
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e124c95621 | ||
|
|
5f1670ffa2 | ||
|
|
b09698e926 | ||
|
|
d35d969b4e | ||
|
|
e751ab55c8 |
@@ -6,12 +6,6 @@ Development
|
|||||||
===========
|
===========
|
||||||
- (Fill this out as you fix issues and develop your features).
|
- (Fill this out as you fix issues and develop your features).
|
||||||
|
|
||||||
Changes in 0.14.0
|
|
||||||
=================
|
|
||||||
- BREAKING CHANGE: Removed the `coerce_types` param from `QuerySet.as_pymongo` #1549
|
|
||||||
- POTENTIAL BREAKING CHANGE: Made EmbeddedDocument not hashable by default #1528
|
|
||||||
- Improved code quality #1531, #1540, #1541, #1547
|
|
||||||
|
|
||||||
Changes in 0.13.0
|
Changes in 0.13.0
|
||||||
=================
|
=================
|
||||||
- POTENTIAL BREAKING CHANGE: Added Unicode support to the `EmailField`, see
|
- POTENTIAL BREAKING CHANGE: Added Unicode support to the `EmailField`, see
|
||||||
|
|||||||
@@ -6,18 +6,6 @@ Development
|
|||||||
***********
|
***********
|
||||||
(Fill this out whenever you introduce breaking changes to MongoEngine)
|
(Fill this out whenever you introduce breaking changes to MongoEngine)
|
||||||
|
|
||||||
0.14.0
|
|
||||||
******
|
|
||||||
This release includes a few bug fixes and a significant code cleanup. The most
|
|
||||||
important change is that `QuerySet.as_pymongo` no longer supports a
|
|
||||||
`coerce_types` mode. If you used it in the past, a) please let us know of your
|
|
||||||
use case, b) you'll need to override `as_pymongo` to get the desired outcome.
|
|
||||||
|
|
||||||
This release also makes the EmbeddedDocument not hashable by default. If you
|
|
||||||
use embedded documents in sets or dictionaries, you might have to override
|
|
||||||
`__hash__` and implement a hashing logic specific to your use case. See #1528
|
|
||||||
for the reason behind this change.
|
|
||||||
|
|
||||||
0.13.0
|
0.13.0
|
||||||
******
|
******
|
||||||
This release adds Unicode support to the `EmailField` and changes its
|
This release adds Unicode support to the `EmailField` and changes its
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ __all__ = (list(document.__all__) + list(fields.__all__) +
|
|||||||
list(signals.__all__) + list(errors.__all__))
|
list(signals.__all__) + list(errors.__all__))
|
||||||
|
|
||||||
|
|
||||||
VERSION = (0, 14, 0)
|
VERSION = (0, 13, 0)
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
|
|||||||
@@ -4931,6 +4931,7 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
self.assertTrue(Person.objects._has_data(),
|
self.assertTrue(Person.objects._has_data(),
|
||||||
'Cursor has data and returned False')
|
'Cursor has data and returned False')
|
||||||
|
|
||||||
|
@needs_mongodb_v26
|
||||||
def test_queryset_aggregation_framework(self):
|
def test_queryset_aggregation_framework(self):
|
||||||
class Person(Document):
|
class Person(Document):
|
||||||
name = StringField()
|
name = StringField()
|
||||||
@@ -4938,13 +4939,19 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
|
|
||||||
Person.drop_collection()
|
Person.drop_collection()
|
||||||
|
|
||||||
p1 = Person.objects.create(name="Isabella Luanna", age=16)
|
p1 = Person(name="Isabella Luanna", age=16)
|
||||||
p2 = Person.objects.create(name="Wilson Junior", age=21)
|
p1.save()
|
||||||
p3 = Person.objects.create(name="Sandra Mara", age=37)
|
|
||||||
|
p2 = Person(name="Wilson Junior", age=21)
|
||||||
|
p2.save()
|
||||||
|
|
||||||
|
p3 = Person(name="Sandra Mara", age=37)
|
||||||
|
p3.save()
|
||||||
|
|
||||||
data = Person.objects(age__lte=22).aggregate(
|
data = Person.objects(age__lte=22).aggregate(
|
||||||
{'$project': {'name': {'$toUpper': '$name'}}}
|
{'$project': {'name': {'$toUpper': '$name'}}}
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(list(data), [
|
self.assertEqual(list(data), [
|
||||||
{'_id': p1.pk, 'name': "ISABELLA LUANNA"},
|
{'_id': p1.pk, 'name': "ISABELLA LUANNA"},
|
||||||
{'_id': p2.pk, 'name': "WILSON JUNIOR"}
|
{'_id': p2.pk, 'name': "WILSON JUNIOR"}
|
||||||
@@ -4953,6 +4960,7 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
data = Person.objects(age__lte=22).order_by('-name').aggregate(
|
data = Person.objects(age__lte=22).order_by('-name').aggregate(
|
||||||
{'$project': {'name': {'$toUpper': '$name'}}}
|
{'$project': {'name': {'$toUpper': '$name'}}}
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(list(data), [
|
self.assertEqual(list(data), [
|
||||||
{'_id': p2.pk, 'name': "WILSON JUNIOR"},
|
{'_id': p2.pk, 'name': "WILSON JUNIOR"},
|
||||||
{'_id': p1.pk, 'name': "ISABELLA LUANNA"}
|
{'_id': p1.pk, 'name': "ISABELLA LUANNA"}
|
||||||
|
|||||||
Reference in New Issue
Block a user