Allow strings to be used in index creation #677
This commit is contained in:
parent
1bd83cc9bc
commit
94e177c0ef
3
AUTHORS
3
AUTHORS
@ -202,4 +202,5 @@ that much better:
|
||||
* François Schmidts (https://github.com/jaesivsm)
|
||||
* Eric Plumb (https://github.com/professorplumb)
|
||||
* Damien Churchill (https://github.com/damoxc)
|
||||
* Aleksandr Sorokoumov (https://github.com/Gerrrr)
|
||||
* Aleksandr Sorokoumov (https://github.com/Gerrrr)
|
||||
* Clay McClure (https://github.com/claymation)
|
@ -6,6 +6,7 @@ Changelog
|
||||
Changes in 0.9.X - DEV
|
||||
======================
|
||||
|
||||
- Allow strings to be used in index creation #675
|
||||
- Fixed EmbeddedDoc weakref proxy issue #592
|
||||
- Fixed nested reference field distinct error #583
|
||||
- Fixed change tracking on nested MapFields #539
|
||||
|
@ -727,5 +727,20 @@ class IndexesTest(unittest.TestCase):
|
||||
report.to_mongo())
|
||||
self.assertEqual(report, Report.objects.get(pk=my_key))
|
||||
|
||||
|
||||
def test_string_indexes(self):
|
||||
|
||||
class MyDoc(Document):
|
||||
provider_ids = DictField()
|
||||
meta = {
|
||||
"indexes": ["provider_ids.foo", "provider_ids.bar"],
|
||||
}
|
||||
|
||||
info = MyDoc.objects._collection.index_information()
|
||||
info = [value['key'] for key, value in info.iteritems()]
|
||||
self.assertTrue([('provider_ids.foo', 1)] in info)
|
||||
self.assertTrue([('provider_ids.bar', 1)] in info)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user