260 Commits

Author SHA1 Message Date
Axel Haustant
959740a585 Fix false positive test on _instance 2015-10-19 16:33:40 +02:00
Gang Li
3fe93968a6 update test case for: Please recall fix on: Saving document doesn't create new fields in existing collection #620 #1126 2015-10-18 00:19:36 -04:00
Catstyle
ba0934e41e added DynamicTest.test_reload_dynamic_field 2015-09-02 18:42:30 +02:00
Emmanuel Leblond
3ffaf2c0e1 Correct SaveConditionError involved tests 2015-07-15 11:59:29 +02:00
David Bordeynik
5334ea393e fix-#842: Fix ignored chained options 2015-07-02 23:08:09 +03:00
Matthieu Rigal
0aeb1ca408 Various fixes again 2015-06-24 00:50:36 +02:00
Matthieu Rigal
49c0c9f44c Simplified lookup-field method, allowing dynamic lookup for more than two parts 2015-06-22 14:55:06 +02:00
Matthieu Rigal
2a3d3de0b2 CappedCollection max_size normalized to multiple of 256 2015-06-15 00:22:07 +02:00
Matthieu Rigal
915849b2ce Implemented method to auto-generate non-collisioning auto_id names 2015-06-11 22:48:34 +02:00
mrigal
051cd744ad added another test to proove we still do not handle all cases well 2015-06-11 22:47:10 +02:00
mrigal
53fbc165ba added content of PR #688 with a test to proove it is a bit right 2015-06-11 22:47:10 +02:00
mrigal
1862bcf867 added test for abstract document without pk creation and adapted behaviour 2015-06-11 22:47:10 +02:00
Emmanuel Leblond
153c239c9b Replace assertRaisesRegexp by assertRaises (python2.6 compatibility) 2015-06-11 14:36:51 +02:00
Emmanuel Leblond
4034ab4182 Clean save_condition exception implementation and related tests 2015-06-11 14:30:10 +02:00
Emmanuel Leblond
3e000f9be1 Raise error if save_condition fails #991 2015-06-11 14:29:42 +02:00
Matthieu Rigal
a0257ed7e7 Updated test to use new create_index method 2015-06-02 00:14:18 +02:00
Matthieu Rigal
f35d0b2b37 Added create_index method, warnings for drop_dups and a geohaystack test 2015-06-01 23:12:43 +02:00
Matthieu Rigal
283e92d55d Added hashed index, a bit more of geo-indexes, possibility to give _cls and docs 2015-06-01 22:11:21 +02:00
Matthieu Rigal
f97db93212 corrected test for MongoDB 2.X 2015-05-07 12:48:25 +02:00
Matthieu Rigal
1005c99e9c corrected index test for MongoDB 3+ 2015-05-07 12:47:31 +02:00
mrigal
c5ed308ea5 comments update after having tested PyMongo 3.0.1 2015-05-07 12:47:31 +02:00
mrigal
f31f52ff1c corrected test condition, depending on mongodb and not pymongo version 2015-05-07 12:47:30 +02:00
mrigal
48316ba60d implemented global IS_PYMONGO_3 2015-05-07 12:47:29 +02:00
mrigal
ccbd128fa2 first adaptations after comments and find-outs 2015-05-07 12:47:29 +02:00
mrigal
36eedc987c adapted index test to new explain output in pymongo3 and added comment to a possible pymongo3 bug 2015-05-07 12:47:29 +02:00
Stefan Wojcik
9bdc320cf8 dont send a "cls" option to ensureIndex (related to https://jira.mongodb.org/browse/SERVER-769) 2015-05-06 11:25:45 +02:00
Matthew Ellison
06e4ed1bb4 Merge pull request #976 from seglberg/bugfix/#954-ref-field-subclass
Reflect Inheritance in Field's 'owner_document'
2015-04-30 09:22:15 -04:00
Eremeev Danil
a4f2f811d3 removed forgotten print 2015-04-30 09:33:19 +05:00
Eremeev Danil
ebaba95eb3 fixed same bug for nested List inside MapField, little code refactoring, added test for nested list and nested reference fields 2015-04-30 09:33:19 +05:00
elephant
7726be94be fixed wrong _delta results on nested MapFields #931 2015-04-30 09:33:18 +05:00
Matthew Ellison
f2cbcea6d7 Unit Tests for #954 Fail on Exception, not Error 2015-04-29 14:26:05 -04:00
Matthew Ellison
5d6a28954b Reflect Inheritance in Field's 'owner_document'
The 'owner_document' property of a Field now reflects the parent field
which first contained the Field when a Document in inherited.

Fixes #954
Closes #955
2015-04-29 14:23:57 -04:00
Sridhar Sundarraman
319f1deceb Unit Test to Demonstrate #954 2015-04-29 14:23:57 -04:00
Axel Haustant
52c7b68cc3 Restore Py26 compatibility on assertRaises 2015-04-13 22:28:58 +02:00
Axel Haustant
cd2d9517a0 Added 'strict' meta parameter 2015-04-13 17:49:08 +02:00
Catstyle
175659628d fix mark_as_changed: handle higher/lower level changed fields correctly to avoid conflict update error 2015-04-10 11:31:31 +08:00
Eremeev Danil
f77f45b70c _get_changed_fields fix for embedded documents with id field.
removed commented out piece of code

added author and record to changelog
2015-04-09 12:36:48 +05:00
Michael Chase
a6a7cba121 Current class fields when unpickling. Fixes #888
Optimize dereferencing map by using sets.
2015-04-08 19:40:43 -07:00
David Bordeynik
bb77838b3e fix-#914: ListField of embedded docs doesn't set the _instance attribute when iterating over it 2015-04-02 08:59:24 +03:00
Jimmy Shen
ce9d0d7e82 Fix #864: ComplexDateTimeField should fall back to None when null=True 2015-02-19 09:47:38 +02:00
David Bordeynik
25298c72bb Fix #877: Fix tests for pymongo 2.8+ 2015-02-15 10:02:22 +02:00
Matthew Ellison
db36d0a375 Ensure Indexes before Each Save
- Rely on caching within the PyMongo driver to provide lightweight calls
  while indices are cached.
- Closes MongoEngine/mongoengine#812.
2014-12-04 08:45:15 -05:00
Rik
913952ffe1 remove unittest test_no_overwritting_no_data_loss
Now that fields need to be defined explicitly, it's not possible to have
another property with the same name on a model.
https://github.com/MongoEngine/mongoengine/pull/457#issuecomment-47513105
2014-11-29 23:20:30 -02:00
Matthew Ellison
bc53dd6830 Generate Unique Indices for Lists of EmbeddedDocs
- Unique indices are now created in the database for EmbeddedDocument
  fields when the EmbeddedDocument is in a ListField
- Closes Issue #358
2014-11-19 22:37:27 -05:00
Yohan Graterol
a12b2de74a Fix merge MongoEngine/mongoengine#799 2014-11-09 21:31:56 -05:00
Yohan Graterol
5583cf0a5f PEP8 compliance tests/document/instance.py 2014-11-09 21:27:23 -05:00
Yohan Graterol
57d772fa23 Fix merge in tests/document/instance.py 2014-11-09 21:19:05 -05:00
André Ericson
2af55baa9a Better BaseDocument equality check when not saved
When 2 instances of a Document had id = None they would be considered
equal unless an __eq__ were implemented.

We now return False for such case. It now behaves more similar to
Django's ORM.
2014-11-09 16:19:15 -03:00
David Bordeynik
0452eec11d fix-#771: OperationError: Shard Keys are immutable. Tried to update id even though the document is not yet saved 2014-11-09 19:23:49 +02:00
André Ericson
3569529a84 Fix KeyError on reload() from a DynamicDocument
If the document is in memory and a field is deleted from the db,
calling reload() would raise a KeyError.
2014-11-08 19:11:51 -03:00