Allow strings to be used in index creation #677
This commit is contained in:
parent
1bd83cc9bc
commit
94e177c0ef
1
AUTHORS
1
AUTHORS
@ -203,3 +203,4 @@ that much better:
|
|||||||
* Eric Plumb (https://github.com/professorplumb)
|
* Eric Plumb (https://github.com/professorplumb)
|
||||||
* Damien Churchill (https://github.com/damoxc)
|
* 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
|
Changes in 0.9.X - DEV
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
- Allow strings to be used in index creation #675
|
||||||
- Fixed EmbeddedDoc weakref proxy issue #592
|
- Fixed EmbeddedDoc weakref proxy issue #592
|
||||||
- Fixed nested reference field distinct error #583
|
- Fixed nested reference field distinct error #583
|
||||||
- Fixed change tracking on nested MapFields #539
|
- Fixed change tracking on nested MapFields #539
|
||||||
|
@ -727,5 +727,20 @@ class IndexesTest(unittest.TestCase):
|
|||||||
report.to_mongo())
|
report.to_mongo())
|
||||||
self.assertEqual(report, Report.objects.get(pk=my_key))
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user