40 Commits

Author SHA1 Message Date
Vincent Driessen
07dae64d66 More the deletion code over to the QuerySet object.
The Document object doens't have any delete_rule specific code anymore,
and leverages the QuerySet's ability to deny/cascade/nullify its
relations.
2010-12-13 12:36:24 -08:00
Vincent Driessen
3c98a4bff5 Remove accidentally left behind debugging message. 2010-12-06 00:07:30 -08:00
Vincent Driessen
b06d794854 Implementation of DENY rules. 2010-12-05 23:43:19 -08:00
Vincent Driessen
d21434dfd6 Make the nullification an atomic operation.
This shortcut works now, since hmarr fixed the unset bug in dev.
2010-12-05 22:41:16 -08:00
Vincent Driessen
dd21ce9eac Initial implementation of the NULLIFY rule. 2010-12-05 22:24:27 -08:00
Vincent Driessen
86233bcdf5 Added initial implementation of cascading document deletion.
The current implementation is still very basic and needs some polish.
The essence of it is that each Document gets a new meta attribute called
"delete_rules" that is a dictionary containing (documentclass,
fieldname) as key and the actual delete rule as a value.  (Possible
values are DO_NOTHING, NULLIFY, CASCADE and DENY.  Of those, only
CASCADE is currently implented.)
2010-12-05 22:24:27 -08:00
Steve Challis
67a9b358a0 Merge branch 'v0.4' of git://github.com/hmarr/mongoengine into v0.4 2010-09-29 23:39:09 +01:00
Steve Challis
b5eb3ea1cd Added a Django storage backend.
- New GridFSStorage storage backend
- New FileDocument document for storing files in GridFS
- Whitespace cleaned up in various files
2010-09-29 23:36:58 +01:00
Nicolas Perriault
449f5a00dc added a 'validate' option to Document.save() +docs +tests 2010-09-11 17:45:57 +02:00
blackbrrr
447f8d0113 MapReduceDocument.object works with custom primary keys. test included. 2010-03-17 11:31:17 -05:00
blackbrrr
f156da4ec2 bumped version 2010-03-17 00:50:44 -05:00
blackbrrr
9be6c41af7 map/reduce result objects now only have 'key', 'value', and 'object' properties; MapReduceDocument.key_object now returns proper Document subclass; added finalize with Reddit ranking simulation; MapReduceDocuments now yielded; 2010-02-12 14:39:08 -06:00
blackbrrr
5c311eefb1 fixed merge conflict in queryset test 2010-02-12 09:59:09 -06:00
blackbrrr
69d3e0c4b6 added map/reduce support via QuerySet.map_reduce. map_reduce operations respect query specs and ordering, but ordering is currently only applied to map/reduce collection. map/reduce may eventually require its own QuerySet to avoid slicing conflicts. results are returned as lists of MapReduceDocument objects, dynamic objects representing the query. tests and documentation included. considered in the neighborhood of 'good start'. 2010-02-09 14:56:15 -06:00
Harry Marr
89f505bb13 Removed pool_size from connect, minor tidyup 2010-02-04 01:44:52 +00:00
Florian Schlachter
69e9b5d55e fixed unicode-bug; replaced str(err) with err.message 2010-02-02 21:44:11 +01:00
Florian Schlachter
73aff806f3 reset to master, keep working on the dirty-fields-patch in another branch 2010-01-31 18:00:01 +01:00
Florian Schlachter
bbfc2f416e keep track of dirty fields is still work in progress; EmbeddedDocuments still aren't tracked (TBD) 2010-01-31 15:43:40 +01:00
Florian Schlachter
431f006751 new save() method updates only dirty fields. fixes issue #18 2010-01-31 14:40:00 +01:00
Harry Marr
ce69428cc6 Moved validate() to BaseDocument 2010-01-13 16:41:57 +00:00
Harry Marr
afd416c84e Updated docs, added force_insert to save() 2010-01-11 04:15:36 +00:00
Harry Marr
ec927bdd63 Added support for user-defined primary keys (_ids) 2010-01-10 17:13:56 +00:00
Harry Marr
42a58dda57 Added update() and update_one() with tests/docs 2010-01-08 18:39:06 +00:00
Harry Marr
4d695a3544 Added single and multifield uniqueness constraints 2010-01-08 12:04:11 +00:00
Harry Marr
960aea2fd4 Added indexes and Django use to docs 2010-01-07 23:54:57 +00:00
Harry Marr
4c93e2945c Added test for meta[indexes] 2010-01-07 15:46:52 +00:00
Harry Marr
557fb19d13 Query values may be processed before being used 2010-01-06 03:14:21 +00:00
Harry Marr
3bead80f96 Added Document.reload method 2010-01-05 00:25:42 +00:00
Harry Marr
6363b6290b Added capped collections support 2010-01-04 03:33:42 +00:00
Harry Marr
b01596c942 Made field validation lazier 2010-01-03 22:37:55 +00:00
Harry Marr
90e5e5dfa9 Fixed delete(), resolved item_frequencies field 2009-12-28 01:39:29 +00:00
Harry Marr
3d70b65a45 Added queryset_manager decorator 2009-12-23 19:32:00 +00:00
Harry Marr
8a646f0f4c Added API Reference to docs 2009-12-19 16:04:05 +00:00
Harry Marr
5e6a6aa886 Added sort method to QuerySet 2009-12-18 18:41:44 +00:00
Harry Marr
44fc9096a4 Added delete method to Document objects 2009-12-18 16:57:53 +00:00
Harry Marr
0a64f42d5f Renamed Document._id to id (still _id in DB)
Although MongoDB uses _id, underscore prefixed attributes imply
private access in Python and are sometimes may not be accessed
(e.g. in the Django template language), but id should be public.
2009-12-18 16:31:32 +00:00
Harry Marr
f2d4ffa091 Cleaned up _to_{python,mongo} + _validate mess 2009-11-22 17:26:47 +00:00
Harry Marr
d4fc5c9260 Removed CollectionManager, moved work to QuerySet
As CollectionManager has been replaced with QuerySet and
QuerySetManager, collection.py has been renamed queryset.py.
2009-11-22 16:46:08 +00:00
Harry Marr
70ee0f57ea Added Document.drop_collection, cleaned up tests 2009-11-21 20:32:29 +00:00
Harry Marr
3017dc78ed Renamed project to mongoengine 2009-11-21 18:41:10 +00:00