Greg Turner
198ccc028a
made list queries work with regexes (e.g. istartswith)
2010-08-06 20:29:09 +10:00
Theo Julienne
b96e27a7e4
Allow documents to override the 'objects' QuerySetManager
2010-07-30 22:09:00 +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
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
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
51065e7a4d
Closes #46 by instantiating a new default instance for every field by request.
2010-07-25 18:33:33 +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
564f950037
Merge branch 'master' of git://github.com/flosch/mongoengine into v0.4
2010-07-25 15:09:45 +01:00
Harry Marr
be651caa68
Removed a couple of sneaky print statements
2010-07-25 15:02:37 +01: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
Daniel Hasselrot
acbc741037
Made list store empty list by default
2010-07-15 18:20:29 +02: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
Daniel Hasselrot
b89d71bfa5
Do not convert None objects
2010-07-06 14:17:30 +02:00
Daniel Hasselrot
3179c4e4ac
Now only removes _id if none, for real
2010-07-06 11:25:49 +02:00
Daniel Hasselrot
f5e39c0064
Allowed _id to be missing when converting to mongo
2010-07-06 10:25:31 +02:00
vandersonmota
86e2797c57
added a TestCase for tests that uses mongoDB
2010-06-09 22:28:30 -03: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
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
Harry Marr
b23353e376
Fixed inherited document primary key issue
2010-05-24 23:03:30 +01: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
225972e151
Added some handy shortcuts for django users.
2010-05-14 14:03:18 +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
Florian Schlachter
eecc6188a7
fixes issue #41 since unicode kwargs is an feature of python 2.6.5 and above.
2010-04-19 11:34:09 +02:00
Harry Marr
3b4df4615a
Fixed MRO error that occured on document inheritance
2010-04-17 21:45:11 +01:00
Harry Marr
edfda6ad5b
BinaryField returns str not unicode
2010-04-17 21:24:06 +01:00
Florian Schlachter
3c7e8be2e7
Removed create_default since it can be achieved with the default
argument (like default=MyEmbeddedDocument since default takes callables too).
2010-04-17 16:59:09 +02:00
Florian Schlachter
416fcba846
Merge remote branch 'hmarr/master'
...
Conflicts:
mongoengine/base.py
2010-04-17 01:42:26 +02:00
Florian Schlachter
e196e229cd
Accepting a tuple for validation argument.
2010-04-17 01:36:45 +02:00
Florian Schlachter
da57572409
Introduced new create_default field argument. If set to true, mongoengine will automagically create an instance of the desired document class (useful if using EmbeddedDocumentField for example):
...
class SubDoc(EmbeddedDocument):
url = URLField()
class MyDoc(Document):
subdoc = EmbeddedDocumentField(SubDoc, create_default=True)
With create_default MyDoc().subdoc is automatically instantiated. Hint: default=SubDoc() WON'T work (that's why I've introduced create_default)
2010-04-17 01:23:14 +02:00
Florian Schlachter
ef172712da
bugfix
2010-04-16 22:25:45 +02:00
Florian Schlachter
170c56bcb9
introduced min_length for a StringField
2010-04-16 18:13:11 +02:00
Florian Schlachter
f3ca9fa4c5
Make validation-lists possible. Example:
...
class Doc(Document):
country = StringField(validation=['DE', 'AT', 'CH'])
2010-04-16 18:00:51 +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
Don Spaulding
ee0c75a26d
Add choices keyword argument to BaseField.__init__()
2010-04-15 17:59:35 -05:00