220 Commits

Author SHA1 Message Date
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
Harry Marr
047cc218a6 Merge branch 'mapreduce' of git://github.com/blackbrrr/mongoengine
Conflicts:
	mongoengine/queryset.py
2010-03-17 12:31:08 +00:00
Harry Marr
39fc862676 Merge branch 'upsert' of git://github.com/blackbrrr/mongoengine 2010-03-17 12:30:18 +00:00
blackbrrr
f156da4ec2 bumped version 2010-03-17 00:50:44 -05:00
blackbrrr
0b62c9d2f6 Merge branch 'master' of git://github.com/hmarr/mongoengine 2010-03-17 00:34:00 -05:00
blackbrrr
acda64a837 fixed field_js merge artifact 2010-03-09 15:31:28 -06:00
blackbrrr
49a001a93a re-added missing QuerySet._ordering 2010-03-09 15:28:55 -06:00
blackbrrr
22a6ec7794 merged conflicts 2010-03-09 15:19:14 -06:00
blackbrrr
26c6e4997c added 'upsert' arg to QuerySet.update and QuerySet.update_one 2010-03-08 21:59:54 -06:00
Harry Marr
ac3c857e1a Added rewind to QuerySet, which is implicitly called when iteration finishes 2010-03-08 22:15:40 +00:00
Harry Marr
95a7b33fb4 Changed how GenericReferenceFields are stored / queried 2010-02-28 23:15:21 +00:00
Harry Marr
5e2c5fa97b Merge branch 'regex-query-shortcuts' 2010-02-28 17:38:03 +00:00
Harry Marr
265776566e QuerySet.only field name translation and polymorphism fix 2010-02-26 19:43:26 +00:00
Harry Marr
6e77e32855 Fixed Q object ObjectId comparison issue 2010-02-26 17:13:19 +00:00
Harry Marr
0b1c506626 Added Q object support for regexes (inc. operator shortcuts) 2010-02-26 16:46:07 +00:00
Harry Marr
66520c77f8 Added regex match operators with test 2010-02-26 13:43:45 +00:00
Harry Marr
ab2d019349 Added server-side js docs 2010-02-26 13:23:15 +00:00