395 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
sshwsfc
ca8c3981c4 2010-11-18 22:35:11 -08:00
sshwsfc
ca56785cbc add some prepare_query_value method for fields 2010-11-18 21:33:05 -08:00
Viktor Kerkez
e1282028a5 Added django style choices 2010-11-01 14:54:55 +01:00
Steve Challis
d7c42861fb Minor GridFS corrections 2010-10-18 10:25:06 +01:00
Steve Challis
67736c849d Finished GridFS Documentation
* Also made GridFS replace test pass
2010-10-18 00:55:44 +01:00
Steve Challis
39e27735cc Merge branch 'v0.4' of git://github.com/hmarr/mongoengine into v0.4
Conflicts:
	docs/changelog.rst
	mongoengine/base.py
	mongoengine/queryset.py
2010-10-17 23:48:20 +01:00
Harry Marr
0902b95764 Added support for recursive embedded documents 2010-10-18 00:27:40 +01:00
Steve Challis
dc7181a3fd Begun GridFS documentation 2010-10-17 23:43:58 +01:00
Harry Marr
6817f3b7ba Updated docs for v0.4 2010-10-17 15:40:49 +01:00
Harry Marr
3591593ac7 Fixed GenericReferenceField query issue 2010-10-17 13:55:48 +01:00
Harry Marr
d3c2dfbaee Merge branch 'master' of http://github.com/ixc/mongoengine into v0.4
Conflicts:
	mongoengine/fields.py
	mongoengine/queryset.py
2010-10-17 13:54:16 +01:00
Harry Marr
3acfd90720 Added some imports for PyMongo 1.9 compatibility. 2010-10-04 14:58:00 +01:00
Harry Marr
159923fae2 Made lists of recursive reference fields possible 2010-10-03 01:48:42 +01: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
98bc0a7c10 Raise AttributeError when necessary on GridFSProxy 2010-09-25 22:47:09 +01:00
Greg Turner
b7e84031e3 Escape strings for regex query. 2010-09-16 14:37:18 +10:00
Steve Challis
bd1bf9ba24 Merge branch 'v0.4' of git://github.com/hmarr/mongoengine into v0.4
Conflicts:
	mongoengine/fields.py
	tests/fields.py
2010-08-31 00:25:10 +01:00
Harry Marr
1849f75ad0 Made GridFSProxy a bit stricter / safer 2010-08-31 00:23:59 +01:00
Harry Marr
32e66b29f4 Fixed FileField problem caused by shared objects 2010-08-30 22:12:05 +01:00
Mircea Pasoi
266f33adc4 Bug fix for gridfs FileField. 2010-08-30 17:38:28 +01:00
Harry Marr
40eb23a97a Merge branch 'master' of git://github.com/flosch/mongoengine into v0.4
Conflicts:
	tests/fields.py
2010-08-30 13:21:10 +01:00
Harry Marr
3b62cf80cd Fixed {Dict,List}Field default issue. Closes #46. 2010-08-30 13:00:34 +01:00
Greg Turner
6373e20696 Better error reporting on a validation error for a list. 2010-08-13 22:28:26 +10:00
Greg Turner
198ccc028a made list queries work with regexes (e.g. istartswith) 2010-08-06 20:29:09 +10:00
flosch
6791f205af Style fix. 2010-07-26 16:50:09 +02:00
flosch
7ab2e21c10 Handle unsafe expressions when using startswith/endswith/contains with unsafe expressions. Closes #58 2010-07-26 16:42:10 +02:00
flosch
51065e7a4d Closes #46 by instantiating a new default instance for every field by request. 2010-07-25 18:33:33 +02:00
Florian Schlachter
aa00feb6a5 FileField's values are now optional. When no value is applied, no File object is created and referenced. 2010-07-20 22:46:00 +02:00
Florian Schlachter
03c0fd9ada Make default value of DictField an empty dict instead of None. 2010-07-19 19:01:53 +02:00
Daniel Hasselrot
6093e88eeb Made list store empty list by default 2010-07-19 08:07:03 +08:00
Florian Schlachter
d3495896fa Merge branch 'master' of github.com:flosch/mongoengine 2010-07-19 01:12:16 +02:00
Florian Schlachter
323c86308a Merge remote branch 'hmarr/v0.4'
Conflicts:
	mongoengine/fields.py
	tests/fields.py
2010-07-19 01:11:28 +02:00
martin
f9057e1a28 Fixed bug in FileField, proxy was not getting the grid_id set 2010-07-19 07:03:45 +08:00
Steve Challis
47bfeec115 Tidied code, added replace() method to FileField 2010-07-19 06:53:21 +08:00
martin
6bfd6c322b Fixed bug with GeoLocationField 2010-07-19 06:52:57 +08:00
Steve Challis
0512dd4c25 Added new FileField with GridFS support
The API is similar to that of PyMongo and most of the same operations are
possible.

The FileField can be written too with put(), write() or by using the assignment
operator. All three cases are demonstrated in the tests. Metadata can be added
to a FileField by assigning keyword arguments when using put() or new_file().
2010-07-19 06:52:11 +08: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
Steve Challis
39b749432a Tidied code, added replace() method to FileField 2010-06-03 08:27:21 +01:00
Steve Challis
0ad343484f Added new FileField with GridFS support
The API is similar to that of PyMongo and most of the same operations are
possible.

The FileField can be written too with put(), write() or by using the assignment
operator. All three cases are demonstrated in the tests. Metadata can be added
to a FileField by assigning keyword arguments when using put() or new_file().
2010-06-02 20:53:39 +01:00
Flavio Amieiro
a2c78c9063 Add 'exact' and 'iexact' match operators for QuerySets 2010-05-26 20:24:57 -03: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
416fcba846 Merge remote branch 'hmarr/master'
Conflicts:
	mongoengine/base.py
2010-04-17 01:42:26 +02:00
Florian Schlachter
170c56bcb9 introduced min_length for a StringField 2010-04-16 18:13:11 +02: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
Josh Ourisman
c8e466a160 Moved SortedListField stuff into its own branch 2010-04-12 12:31:52 -04:00
Harry Marr
90200dbe9c Fixed DecimalField bug 2010-04-12 15:59:20 +01:00