395 Commits

Author SHA1 Message Date
Ross Lawley
56d1139d71 Added ImageField Support
Thanks to @wpjunior for the patch
Closes [#298]
2011-10-27 00:58:47 -07:00
Nicolas Perriault
a1db437c42 got rid of assert for validation; ValidationError now extends AssertionError for BC purpose 2011-10-25 22:38:43 +02:00
Nicolas Perriault
7db5335420 fixed URLField.validate() wasn't using BaseField.error() to raise a ValidationError 2011-10-25 10:53:58 +02:00
Nicolas Perriault
3d7b30da77 first version of BC validation schema 2011-10-24 01:02:31 +02:00
Wilson Júnior
b09c52fc7e fixes for #325 issue 2011-10-19 06:30:41 -02:00
Ross Lawley
3d97c41fe9 Merge pull request #305 from linuxnow/integration/error_msgs
Add field name to validation exception messages
2011-10-08 08:13:40 -07:00
Pau Aliagas
3aa2233b5d Add field name to exception messages 2011-10-04 18:35:32 +02:00
Pau Aliagas
d59862ae6e Merge remote-tracking branch 'upstream/dev' into integration/uuid 2011-10-04 16:02:58 +02:00
Ross Lawley
6961a9494f Updates to ComplexFields
Required now means they cannot be empty [#302]
2011-10-04 04:26:56 -07:00
Pau Aliagas
bec6805296 Add UUIDField 2011-10-04 10:20:41 +02:00
Pau Aliagas
d99c7c20cc Don't allow empty lists when they are required
When using ListField, an empty list is added as the default value.
But when you mark this field as required, you expect it not to be empty,
so this patch makes sure that this is duly checked.
2011-10-04 10:12:21 +02:00
Pau Aliagas
9b4d0f6450 Make sure that ListFields are not strings 2011-10-03 05:29:24 -07:00
Ross Lawley
89c44cd14e Added missing fields to the api documentation 2011-09-11 08:09:16 +01:00
Ross Lawley
b8a5791de6 Updates to documents
[#245]
2011-09-09 14:33:27 +01:00
Ross Lawley
2bc3948726 Merge remote branch 'wpjunior/genericembeddedfield' into genericembeddedfield 2011-09-09 06:07:07 -07:00
Ross Lawley
bc9a09f52e Document updates 2011-09-09 04:21:32 -07:00
Ross Lawley
3f301f6b0f Finishing touches to where implementation - thanks to dcrosta
Refs #242
2011-08-16 10:32:21 +01:00
Wilson Júnior
6471c6e133 added GenericEmbeddedDocumentField 2011-07-27 08:45:15 -03:00
Wilson Júnior
130fb9916d fixes for SequenceField 2011-07-22 10:19:41 -03:00
Ross Lawley
5834fa840c Tweaked SequenceField so that it doesn't increment on creation.
[refs #238]
2011-07-19 16:51:26 +01:00
Wilson Júnior
fa39789bac added SequenceField 2011-07-18 12:44:28 -03:00
Ross Lawley
dc5a613bc7 Fixes conversion of null genericreferences in querysets
closes #211
2011-07-11 09:19:27 +01:00
Ross Lawley
d51d95a28e Merge pull request #212 from zakj/dev
Added GridFSProxy.__nonzero__ - thanks to zakj for the fix
2011-06-30 01:57:00 -07:00
Zak Johnson
3d15a3b3e2 Add GridFSProxy.__nonzero__
For documents that do not have a value set for a given field, most field types
return None (or [] in the case of ListField). This makes it easy to test
whether a field has been set using "if doc.field". FileFields, on the other
hand, always return a GridFSProxy. Adding GridFSProxy.__nonzero__ which simply
checks for a grid_id allows the same boolean-test pattern for FileFields, as
well.
2011-06-29 20:48:39 -07:00
Ross Lawley
4036e9fe34 Moved private method to make class more readable 2011-06-27 13:17:41 +01:00
Ross Lawley
f41c5217c6 Added a cleaner way to get collection names
Also handles dynamic collection naming - refs #180.
2011-06-20 11:48:12 +01:00
Ross Lawley
5cc9188c5b Improved validation of (Generic)Reference fields 2011-06-16 15:25:09 +01:00
Ross Lawley
658b85d327 Inconsistent setting of '_cls' broke inherited document referencing
Fixes #199
2011-06-15 16:51:49 +01:00
Ross Lawley
576db9ca88 Fixes DateTimeField handling of date objects.
Fixes #191
2011-06-14 15:09:03 +01:00
Ross Lawley
0ed79a839d Added delta tracking to documents.
All saves on exisiting items do set / unset operations only on changed fields.
* Note lists and dicts generally do set operations for things like pop() del[key]
  As there is no easy map to unset and explicitly matches the new list / dict

fixes #18
2011-06-14 14:35:38 +01:00
Ross Lawley
7b29378319 Fixes issue converting to mongo 2011-06-13 12:40:12 +01:00
Ross Lawley
b2848b8519 Added ComplexDateTimeField
Thanks to @pelletier for the code.
Refs #187
2011-06-09 14:20:21 +01:00
Ross Lawley
4b9bacf731 Added ComplexBaseField
* Handles the efficient lazy dereferencing of DBrefs.
* Handles complex nested values in ListFields and DictFields
* Allows for both strictly declared ListFields and DictFields where the embedded
value must be of a field type or no restrictions where the values can be a mix
of field types / values.
* Handles DBrefences of documents where allow_inheritance = False.
2011-06-09 11:25:24 +01:00
Ross Lawley
cfcd77b193 Added tests displaying datetime behaviour.
Updated datetimefield documentation
2011-06-08 10:33:56 +01:00
Ross Lawley
ec7effa0ef Added DereferenceBaseField class
Handles the lazy dereferencing of all items in a list / dict.
Improves query efficiency by an order of magnitude.
2011-06-06 11:04:06 +01:00
Ross Lawley
5d778648e6 Inital tests for dereferencing improvements 2011-05-27 11:33:40 +01:00
Alistair Roche
bf6f03a412 Improved MapFields setting 2011-05-25 17:25:39 +01:00
Ross Lawley
b1cdd1eb26 Updated docs regarding ReferenceFields
Closes #149
2011-05-25 12:01:41 +01:00
Ross Lawley
7ecf84395a Improved DictFields
Allow searching multiple levels deep in DictFields
Allow DictField entries containing strings to use matching operators

Thanks again to @theojulien for the initial code #108
2011-05-24 14:07:58 +01:00
Ross Lawley
32bab13a8a Added MapField, similar to DictField
Similar to DictField except the value of each entry is always of a certain
(declared) field type.

Thanks again to @theojulienne for the code #108
2011-05-24 12:50:48 +01:00
Ross Lawley
9260ff9e83 Updated docs and added a NotRegistered exception
For handling GenericReferences that reference documents that haven't
been imported.

Closes #170
2011-05-20 10:22:22 +01:00
Ross Lawley
efba9ef52a Merge remote branch 'srackham/gridfs-read-seek' into gridfs-read-seek 2011-05-19 10:14:51 +01:00
Ross Lawley
49c978ad9e Merge remote branch 'upstream/master' 2011-05-09 09:01:19 +01:00
Stuart Rackham
829df581f0 Drop gridfs close warning 2011-04-04 15:19:57 +12:00
Stuart Rackham
bd84d08b95 Fixed misspelt variable name. 2011-04-04 13:44:36 +12:00
Stuart Rackham
2c7469c62a Additional file-like behavior for FileField (optional size arg for read
method; fixed seek and tell methods for reading files).
2011-04-03 15:21:00 +12:00
Harry Marr
ce8b3ea0a1 Merge remote branch 'nvie/dev' into dev 2011-01-09 23:29:11 +00:00
Harry Marr
559fc46037 Merge branch 'master' of https://github.com/sshwsfc/mongoengine into sshwsfc-dev 2011-01-09 23:21:22 +00:00
Vincent Driessen
07ef58c1a7 Rename delete_rule -> reverse_delete_rule. 2010-12-20 05:55:46 -08:00
Vincent Driessen
ffc8b21f67 Some tests broke over the default None value. 2010-12-14 03:50:49 -08:00