236 Commits

Author SHA1 Message Date
Harry Marr
b4c54b1b62 Added support for the $not operator 2010-10-04 11:41:49 +01:00
Harry Marr
76cb851c40 Replaced old Q-object with new, revamped Q-object 2010-10-04 11:41:07 +01:00
Harry Marr
3fcc0e9789 Combining OR nodes works, fixed other Q-object bugs 2010-10-04 02:10:37 +01:00
Harry Marr
8e65154201 Added a tree transformer, got complex ANDs working 2010-10-04 00:06:42 +01:00
Harry Marr
c0f7c4ca2d Fixed error in empty property on QCombination 2010-10-03 23:22:36 +01:00
Harry Marr
db2f64c290 Made query-tree code a bit clearer 2010-10-03 23:01:44 +01:00
Harry Marr
a3c46fec07 Compilation of combinations - simple $or now works 2010-10-03 21:26:26 +01:00
Harry Marr
62388cb740 Started work on new Q-object implementation 2010-10-03 21:08:28 +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
556eed0151 QuerySet.distinct respects query. Closes #64. 2010-10-03 15:22:47 +01:00
Harry Marr
4012722a8d QuerySet.item_frequencies works with non-list fields 2010-10-03 15:01:45 +01:00
Harry Marr
4c68bc6c96 Merge branch 'master' of http://github.com/sibsibsib/mongoengine into v0.4
Conflicts:
	mongoengine/queryset.py
	tests/queryset.py
2010-10-03 01:57:22 +01:00
sib
2c8f004103 added update operator for addToSet 2010-09-30 02:53:44 -03: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
Harry Marr
d158727154 Merge branch 'v0.4' of github.com:hmarr/mongoengine into v0.4 2010-09-19 17:18:39 +01:00
Harry Marr
73092dcb33 QuerySet update method returns num affected docs 2010-09-19 17:17:37 +01:00
Harry Marr
f11ee1f9cf Added support for using custom QuerySet classes 2010-09-15 09:47:13 +01:00
Harry Marr
2af5f3c56e Added support for querying by array position. Closes #36. 2010-08-31 00:24:30 +01:00
Harry Marr
17642c8a8c Fixed QuerySet.average issue that ignored 0 2010-08-30 19:48:17 +01:00
Mircea Pasoi
3e30d71263 Support for background and drop_dups indexing options. 2010-08-30 17:39:41 +01:00
Harry Marr
3297578e8d Merge branch 'master' of http://github.com/richardhenry/mongoengine into v0.4 2010-08-30 13:57:42 +01:00
Richard Henry
7de9adc6b1 Adding support for pop operations to QuerySet.update and QuerySet.update_one 2010-08-28 09:36:25 +01:00
Greg Turner
d274576b47 Fixed premature return for query gen 2010-08-13 22:30:36 +10:00
Greg Turner
809fe44b43 Added a __raw__ parameter for passing query dictionaries directly to pymongo 2010-08-12 15:14:20 +10:00
flosch
21d267cb11 Now order_by() works like queries for referencing deeper fields (replacing . with __). old: order_by('mydoc.myattr') / new: order_by('mydoc__myattr'). Closes #45 2010-07-26 17:28:59 +02:00
flosch
2f991ac6f1 Added all() method to get all document instances from a document. Extended the FileField's tests with testing on empty filefield. 2010-07-25 19:02:15 +02:00
flosch
9411b38508 Removed unnecessary comment. 2010-07-25 18:45:49 +02:00
flosch
327452622e Handle DBRefs correctly within Q objects. Closes #55 2010-07-25 18:22:26 +02:00
flosch
13316e5380 Introduced new Document.objects.create, like django has. It creates a new object, saves it and returns the new object instance. 2010-07-25 17:35:09 +02:00
Harry Marr
9f98025b8c Added QuerySet.distinct. Closes #44. 2010-07-25 15:29:02 +01:00
Harry Marr
be651caa68 Removed a couple of sneaky print statements 2010-07-25 15:02:37 +01:00
Harry Marr
71689fcf23 Got within_box working for Geo fields 2010-07-07 15:00:46 +01:00
Harry Marr
1c334141ee Merge branch 'geo' of git://github.com/blackbrrr/mongoengine into v0.4
Conflicts:
	mongoengine/fields.py
	mongoengine/queryset.py
2010-07-07 14:53:25 +01:00
Harry Marr
196606438c Fixed Q-object list query issue 2010-05-30 18:34:06 +01:00
Flavio Amieiro
a2c78c9063 Add 'exact' and 'iexact' match operators for QuerySets 2010-05-26 20:24:57 -03:00
Stephan Jaekel
f657432be3 always ignore empty Q objects, if the new Q is empty, the old one will be returned. 2010-05-14 14:35:27 +02:00
Stephan Jaekel
4972bdb383 ignore empty Q objects when combining Q objects. 2010-05-14 14:02:39 +02:00
Florian Schlachter
9df725165b Added a possibility to define a base class for fields from a DictField (instead of using BaseField). This is important if you want to use field-based query abilities like StringField's startswith/endswith/contains. Just define `basecls´ when defining your DictField. Example:
class Test(Document):

    name = StringField()
    translations = DictField(basecls=StringField)

Without basecls defined:

> Test.objects(translations__german__startswith='Deutsch')
[]

With basecls set to StringField:

> Test.objects(translations__german__startswith='Deutsch')
[<Test: Test object>]
2010-05-14 13:35:45 +02:00
Harry Marr
edfda6ad5b BinaryField returns str not unicode 2010-04-17 21:24:06 +01:00
Florian Schlachter
48facec524 Fixes tiny documentation error. Adds possibility to add custom validation methods to fields, e. g.:
class Customer(Document):
        country = StringField(validation=lambda value: value in ['DE', 'AT', 'CH'])

Replaced some str() with unicode() for i18n reasons.
2010-04-16 16:59:34 +02:00
Florian Schlachter
0a074e52e0 Merge remote branch 'hmarr/master'
Conflicts:
	mongoengine/fields.py
2010-04-15 23:10:34 +02:00
Timothée Peignier
a39685d98c make get_or_create returns a tuple with the retrieved or created object and a boolean specifying whether a new object was created 2010-04-12 16:21:29 +01:00
Florian Schlachter
2304dac8e3 added GeoLocationField with auto index-creation for GEO2D 2010-03-30 00:04:39 +02:00
Deepak Thukral
fbcf58c48f updated documentation 2010-03-29 11:25:17 +02:00
Deepak Thukral
8f4a579df9 DoesNotExist and MultipleObjectsReturned now contributes Document class 2010-03-28 22:22:36 +02:00
Matt Dennewitz
a4d2f22fd2 added 'geo_indexes' to TopLevelDocumentMetaclass; added GeoPointField, a glorified [lat float, lng float] container; added geo lookup operators to QuerySet; added initial geo tests 2010-03-23 00:14:01 -05:00
Harry Marr
00c8d7e6f5 Bump to v0.3 2010-03-17 16:50:13 +00:00
Harry Marr
5b42578cb1 Added ~ field name substitution to mapreduce funcs 2010-03-17 14:06:31 +00:00
Harry Marr
25a0a5364a Deprecated 'name' arg for fields in favour of 'db_field' 2010-03-17 13:47:23 +00:00