Ross Lawley
0338ac17b1
Fixes multiple assignment issue preventing saves
...
Thanks to @wpjunior for the ticket and testcase
Also fixed bug in BaseList
fixes #195
2011-06-15 08:57:46 +01:00
Ross Lawley
cb1dfdfac6
Fixes to signals
...
The sender is the class of the document not the instance - easier to
hook into
2011-06-14 16:56:04 +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
fd7f882011
Save no longer tramples over documents now sets or unsets explicit fields.
...
Fixes #146 , refs #18
Thanks @zhangcheng for the initial code
2011-06-09 16:09:06 +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
417bb1b35d
Added regression test for #185
2011-06-09 12:15:36 +01:00
Ross Lawley
199b4eb860
Added django_tests and regression test for order_by
...
Refs #190
2011-06-09 12:08:37 +01:00
Ross Lawley
a66417e9d0
pep8 update
2011-06-09 11:31:47 +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
602d7dad00
Improvements to Abstract Base Classes
...
Added test example highlighting what to do to migrate a class from
complex (allows inheritance) to simple.
2011-06-08 17:10:26 +01:00
Ross Lawley
d32dd9ff62
Added _get_FIELD_display() for handy choice field display lookups
...
closes #188
2011-06-08 13:07:08 +01:00
Colin Howe
4174918476
Merge in upstream dev
2011-06-08 12:33:36 +01:00
Colin Howe
7c62fdc0b8
Allow for types to never be auto-prepended to indices
2011-06-08 12:20:58 +01:00
Ross Lawley
3c88faa889
Updated slave_okay syntax
...
Now inline with .timeout() and .snapshot().
Made them chainable - so its easier to use and added tests for cursor_args
2011-06-08 12:06:26 +01:00
Ross Lawley
cfcd77b193
Added tests displaying datetime behaviour.
...
Updated datetimefield documentation
2011-06-08 10:33:56 +01:00
Ross Lawley
55e20bda12
Added slave_okay syntax to querysets.
...
* slave_okay (optional): if True, allows this query to be run against a replica secondary.
2011-06-06 14:35:46 +01:00
Ross Lawley
56f00a64d7
Added bulk insert method.
...
Updated changelog and added tests / query_counter tests
2011-06-06 12:37:06 +01:00
Ross Lawley
8553022b0e
Merge branch 'dev' into feature/dev-indexes
2011-06-06 11:40:21 +01:00
Ross Lawley
7e87ed79ab
Merge branch 'feature/blinker_signals' into dev
2011-06-06 11:10:12 +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
Colin Howe
40df08c74c
Fix QuerySet.ensure_index for new index specs
2011-05-29 13:33:00 +01:00
Ross Lawley
5d778648e6
Inital tests for dereferencing improvements
2011-05-27 11:33:40 +01:00
Colin Howe
1fa47206aa
Support for sparse indexes and omitting types from indexes
2011-05-26 19:39:41 +01:00
Colin Howe
6f5bd7b0b9
Test needs a connection...
2011-05-26 18:54:52 +01:00
Ross Lawley
c903af032f
Added inline_map_reduce functionality
...
Also added map_reduce method for calculating item_frequencies
Closes #183
2011-05-26 15:44:43 +01:00
Ross Lawley
97a1310344
Tweakin test
2011-05-26 11:11:00 +01:00
Alistair Roche
bf6f03a412
Improved MapFields setting
2011-05-25 17:25:39 +01:00
Ross Lawley
5ab13518db
Added test confirming order_by reference field doesnt work
2011-05-25 13:50:52 +01:00
Ross Lawley
eb892241ee
Added regression test for editting embedded documents
...
Closes #35
2011-05-25 13:31:01 +01:00
Ross Lawley
fac3f038a8
Added regression test for issue with unset and pop
...
Closes #118
2011-05-25 12:20:56 +01:00
Ross Lawley
60c8254f58
Tweaks to item_frequencies
...
Updated to use a ternary statement and added tests
Refs #124 #122
Thanks to @nickvlku for the code.
2011-05-25 11:10:42 +01:00
Ross Lawley
2ce70448b0
Merge branch 'dev' into pull_124
2011-05-25 09:54:56 +01:00
Ross Lawley
c3a8840435
Blinker signals added
2011-05-24 20:27:19 +01:00
Ross Lawley
3246cf8bdd
Merge pull request #177 from sbook/feature/update_lists
...
Added the ability to update individual items in ListFields.
Example:
Message.objects(pk=12).update(set__comments__5__body="Testing 123")
2011-05-24 06:13:10 -07: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
088c40f9f2
Added Abstract Base Classes
...
Thanks to @theojulienne for the code :) #108
2011-05-24 12:30:12 +01:00
Alistair Roche
8427877bd2
Merge remote branch 'upstream/dev' into dev
2011-05-24 11:32:23 +01:00
Alistair Roche
118c0deb7a
Fixed list-indexing syntax; created tests.
2011-05-24 11:31:44 +01:00
Ross Lawley
1126c85903
Added Custom Objects Managers
...
Managers can now be directly declared in a Document eg::
```python
class CustomQuerySetManager(QuerySetManager):
@staticmethod
def get_queryset(doc_cls, queryset):
return queryset(is_published=True)
class Post(Document):
is_published = BooleanField(default=False)
published = CustomQuerySetManager()
```
Refactored the name of the `_manager_func` to `get_queryset` to mark it as
part the public API. If declaring a Manager with a get_queryset method, it
should be a staticmethod, that accepts the document_class and the queryset.
Note - you can still use decorators in fact in the example below,
we effectively do the same thing as the first example and is much less verbose.
```python
class Post(Document):
is_published = BooleanField(default=False)
@queryset_manager
def published(doc_cls, queryset):
return queryset(is_published=True)
```
Thanks to @theojulienne for the initial impetus and code sample #108
2011-05-24 11:26:46 +01:00
Ross Lawley
1b72ea9cc1
Fixed detection of unique=True in embedded documents.
...
Added some more test cases - thanks to @heyman for the initial
test case.
Closes #172
Refs #171
2011-05-20 16:09:03 +01:00
Ross Lawley
04953351f1
Merge branch 'feature/slicing_fields' into dev
2011-05-20 14:18:48 +01:00
Ross Lawley
07e71d9ce9
Regression test for collection names an primary ordering
...
Closes #91
2011-05-20 14:18:16 +01:00
Ross Lawley
5f53cda3ab
Added regression test for #94
2011-05-20 10:55:01 +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
08d1689268
Updated to handle the converntional api style for slicing a field
...
Added testcase to demonstrate embedded slicing as well.
Refs #167
2011-05-20 09:47:41 +01:00
Ross Lawley
40b69baa29
Implementing Write Concern
...
Added write_options dict to save, update, update_one and get_or_create.
Thanks to justquick for the initial ticket and code.
Refs #132
2011-05-19 16:49:00 +01:00
Ross Lawley
b3251818cc
Added regression test for custom queryset ordering
...
Closes #126
2011-05-19 13:04:14 +01:00
Ross Lawley
da8a057ede
Added test showing documents can be pickled
...
Refs #135
2011-05-19 12:41:38 +01:00