diff --git a/AUTHORS b/AUTHORS index c7d57d01..13070b5e 100644 --- a/AUTHORS +++ b/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) \ No newline at end of file + * Aleksandr Sorokoumov (https://github.com/Gerrrr) + * Clay McClure (https://github.com/claymation) \ No newline at end of file diff --git a/docs/changelog.rst b/docs/changelog.rst index de41dd5b..2d9a34c2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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 diff --git a/tests/document/indexes.py b/tests/document/indexes.py index cf6122a3..3fc38092 100644 --- a/tests/document/indexes.py +++ b/tests/document/indexes.py @@ -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()