Compare commits

..

5 Commits

Author SHA1 Message Date
Stefan Wojcik
e124c95621 extra note in the docstring [ci skip] 2017-05-07 23:58:29 -04:00
Stefan Wojcik
5f1670ffa2 fix a unit test that fails from time to time 2017-05-07 23:46:08 -04:00
Stefan Wojcik
b09698e926 remove a print 2017-05-07 23:42:27 -04:00
Stefan Wojcik
d35d969b4e add a test for a generic reference field along with only and as_pymongo 2017-05-07 23:39:35 -04:00
Stefan Wojcik
e751ab55c8 cleaner as_pymongo + drop coerce_types 2017-05-07 23:28:35 -04:00
4 changed files with 12 additions and 22 deletions

View File

@@ -6,12 +6,6 @@ Development
===========
- (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
=================
- POTENTIAL BREAKING CHANGE: Added Unicode support to the `EmailField`, see

View File

@@ -6,18 +6,6 @@ Development
***********
(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
******
This release adds Unicode support to the `EmailField` and changes its

View File

@@ -23,7 +23,7 @@ __all__ = (list(document.__all__) + list(fields.__all__) +
list(signals.__all__) + list(errors.__all__))
VERSION = (0, 14, 0)
VERSION = (0, 13, 0)
def get_version():

View File

@@ -4931,6 +4931,7 @@ class QuerySetTest(unittest.TestCase):
self.assertTrue(Person.objects._has_data(),
'Cursor has data and returned False')
@needs_mongodb_v26
def test_queryset_aggregation_framework(self):
class Person(Document):
name = StringField()
@@ -4938,13 +4939,19 @@ class QuerySetTest(unittest.TestCase):
Person.drop_collection()
p1 = Person.objects.create(name="Isabella Luanna", age=16)
p2 = Person.objects.create(name="Wilson Junior", age=21)
p3 = Person.objects.create(name="Sandra Mara", age=37)
p1 = Person(name="Isabella Luanna", age=16)
p1.save()
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(
{'$project': {'name': {'$toUpper': '$name'}}}
)
self.assertEqual(list(data), [
{'_id': p1.pk, 'name': "ISABELLA LUANNA"},
{'_id': p2.pk, 'name': "WILSON JUNIOR"}
@@ -4953,6 +4960,7 @@ class QuerySetTest(unittest.TestCase):
data = Person.objects(age__lte=22).order_by('-name').aggregate(
{'$project': {'name': {'$toUpper': '$name'}}}
)
self.assertEqual(list(data), [
{'_id': p2.pk, 'name': "WILSON JUNIOR"},
{'_id': p1.pk, 'name': "ISABELLA LUANNA"}