52 Commits

Author SHA1 Message Date
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
Harry Marr
e9d478ed9f Merge branch 'master' of http://github.com/cyberdelia/mongoengine into v0.4 2010-10-18 10:22:56 +01:00
Harry Marr
e93c4c87d8 Fixed inheritance collection issue 2010-10-17 17:41:20 +01:00
Timothée Peignier
9c9903664a add support for pk property in documents and filters 2010-10-03 18:50:35 +02:00
Harry Marr
3d6ee0ce00 Merge branch 'master' of http://github.com/n1k0/mongoengine into v0.4 2010-09-19 19:55:57 +01:00
Nicolas Perriault
449f5a00dc added a 'validate' option to Document.save() +docs +tests 2010-09-11 17:45:57 +02:00
Florian Schlachter
ec519f20fa Makes the tests compatible to pymongo 1.7+. Not backwards compatible! 2010-07-19 01:32:28 +02:00
Harry Marr
b23353e376 Fixed inherited document primary key issue 2010-05-24 23:03:30 +01:00
Harry Marr
3b4df4615a Fixed MRO error that occured on document inheritance 2010-04-17 21:45:11 +01:00
Harry Marr
25a0a5364a Deprecated 'name' arg for fields in favour of 'db_field' 2010-03-17 13:47:23 +00:00
blackbrrr
c4513f0286 merged master 2010-02-11 15:43:37 -06:00
Harry Marr
568000805f EmbeddedDocuments may now be non-polymorphic 2010-01-25 01:00:04 +00:00
blackbrrr
3fb6307596 Merge branch 'master' of git://github.com/hmarr/mongoengine 2010-01-23 18:41:52 -06:00
Harry Marr
470e08f616 exec_js functions now acknowledge Q objects 2010-01-23 03:05:27 +00:00
blackbrrr
f1e51f9708 Merge branch 'master' of git://github.com/hmarr/mongoengine into deferred_fields 2010-01-19 12:27:14 -06:00
Harry Marr
3357b55fbf Indexing on ListFields now works properly 2010-01-16 15:35:01 +00:00
blackbrrr
b3c9a76619 Merge branch 'master' of git://github.com/hmarr/mongoengine 2010-01-14 11:32:39 -06:00
blackbrrr
5f84d6f8f8 added URLField, DecimalField, tests. 2010-01-14 11:32:28 -06: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
45080d3fd1 Merge branch 'master' of git://github.com/blackbrrr/mongoengine
_types index prepended to user defined indexes

Conflicts:
	mongoengine/queryset.py
2010-01-08 06:00:35 +00:00
Harry Marr
54d276f6a7 Added index for _types 2010-01-08 04:49:14 +00:00
Harry Marr
eb3e6963fa Index specs now use proper field names 2010-01-08 00:15:20 +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
17aef253cb Added __len__ to QuerySet 2009-12-24 18:45:35 +00:00
Harry Marr
f687bad202 Accessing a missing field now returns None rather than raising an AttributeError 2009-12-24 17:10:36 +00:00
Harry Marr
e204b84183 Added test for custom collection names on Document 2009-12-21 02:52:30 +00:00
Harry Marr
9d12dbad70 Made _cls etc optional, merged sort to order_by 2009-12-19 02:33:01 +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
1529fd901d Queries may now use multiple operators on fields 2009-11-23 18:16:41 +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
8e89c8b37a Added delete method to QuerySet 2009-11-21 20:03:31 +00:00
Harry Marr
3017dc78ed Renamed project to mongoengine 2009-11-21 18:41:10 +00:00
Harry Marr
5fa01d89a5 Fixed ListField bug, added ReferenceField + tests 2009-11-21 18:15:47 +00:00
Harry Marr
744077b150 Queries now return correct subclasses of Documents 2009-11-19 19:44:51 +00:00
Harry Marr
5fcb5aba7c Added ListField type with unit tests 2009-11-19 16:58:25 +00:00
Harry Marr
8ec6fecd23 Added basic querying - find and find_one 2009-11-19 01:09:58 +00:00
Harry Marr
94be32b387 Created ObjectIdField, removed object_id field parameter 2009-11-18 21:38:41 +00:00
Harry Marr
c99f5c4ec1 Added CollectionManager, made connection module
All connection-related functions are now in connection.py.

Created a ConnectionManager class for interacting with a collection
in the database. Top-level document classes have an instance of
a ConnectionManager (Document.collection).

Defined a 'save' method on top-level document's that uses the collection
manager's '_save_document' method to save the document to the database.

Added tests for CollectionManagers -- all unit tests now require a valid
connection to the database, which is set up in the tests' setUp method.
2009-11-18 19:02:57 +00:00
Harry Marr
688fd5af66 Added connect(), document data now stored as Python
Added document length, contains, etc with tests
2009-11-17 12:32:42 +00:00
Harry Marr
0bb0ec0114 Added unit test for EmbeddedDocument 2009-11-17 01:48:43 +00:00