82 Commits

Author SHA1 Message Date
Mircea Pasoi
f1aec68f23 Inherit index options. 2010-08-30 17:40:01 +01:00
Mircea Pasoi
dcc8d22cec Proper unique index name when using db_field. 2010-08-30 17:38:07 +01:00
Florian Schlachter
185e7a6a7e Better way of checking if new_class has an 'objects' attribute. 2010-08-30 18:38:41 +02:00
Florian Schlachter
c39f315ddc Merge remote branch 'hmarr/v0.4' 2010-08-30 18:38:12 +02:00
Florian Schlachter
e0911a5fe0 Replaced slow exception handling with has_key. 2010-08-30 14:58:58 +02:00
Harry Marr
2635e41f69 Merge branch 'master' of http://github.com/theojulienne/mongoengine into v0.4 2010-08-30 13:54:07 +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
f4711699e4 Merge branch 'master' of http://github.com/danielhasselrot/mongoengine into v0.4
Conflicts:
	mongoengine/fields.py
2010-08-30 13:03:23 +01:00
Theo Julienne
b96e27a7e4 Allow documents to override the 'objects' QuerySetManager 2010-07-30 22:09:00 +10: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
323c86308a Merge remote branch 'hmarr/v0.4'
Conflicts:
	mongoengine/fields.py
	tests/fields.py
2010-07-19 01:11:28 +02:00
Steve Challis
47bfeec115 Tidied code, added replace() method to FileField 2010-07-19 06:53:21 +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
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
Harry Marr
b23353e376 Fixed inherited document primary key issue 2010-05-24 23:03:30 +01: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
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
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
Deepak Thukral
207fd9fcb7 keeping import policy in mind 2010-03-29 11:27:50 +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
25a0a5364a Deprecated 'name' arg for fields in favour of 'db_field' 2010-03-17 13:47:23 +00:00
Deepak Thukral
72161a9b71 no message in expection in future version of python 2010-03-11 21:10:04 +01:00
Deepak Thukral
df8f4e7251 no message in expection in future version of python 2010-03-11 20:42:27 +01:00
Harry Marr
95a7b33fb4 Changed how GenericReferenceFields are stored / queried 2010-02-28 23:15:21 +00:00
Harry Marr
81dd5adccf GenericReferenceField docs 2010-02-28 21:30:54 +00:00
blackbrrr
03d31b1890 added global model registry and GenericReferenceField, a ReferenceField not bound to a particular model 2010-02-26 16:59:12 -06:00
Deepak Thukral
90d9bd9723 added natural object comparision 2010-02-21 12:13:58 +01:00
blackbrrr
348f7b5dfc merged master, fixed 1 merge conflict 2010-02-14 17:23:38 -06:00
Harry Marr
ea1fe6a538 Fixed set/unset issue with ListFields 2010-02-12 11:21:51 +00:00
blackbrrr
c4513f0286 merged master 2010-02-11 15:43:37 -06:00
Florian Schlachter
73aff806f3 reset to master, keep working on the dirty-fields-patch in another branch 2010-01-31 18:00:01 +01:00
Florian Schlachter
963a223e7e Merge remote branch 'hmarr/master'
Conflicts:
	mongoengine/queryset.py
2010-01-31 17:43:56 +01:00
Florian Schlachter
431f006751 new save() method updates only dirty fields. fixes issue #18 2010-01-31 14:40:00 +01:00
Harry Marr
ffc9d7b152 Merge branch 'master' of git://github.com/flosch/mongoengine
Added unit test for get_or_create, merged flosch's get with
punteney's get.

Conflicts:
	mongoengine/queryset.py
2010-01-31 13:24:50 +00:00
Florian Schlachter
7d6e117f68 added get-method to fetch exactly one document from the collection. catching pymongo's ObjectId-errors and raising mongoengine's ValidationError instead. 2010-01-31 01:11:37 +01:00
Harry Marr
bca6119db8 Minor tidyup 2010-01-26 19:36:19 +00:00
Harry Marr
568000805f EmbeddedDocuments may now be non-polymorphic 2010-01-25 01:00:04 +00:00
blackbrrr
f1e51f9708 Merge branch 'master' of git://github.com/hmarr/mongoengine into deferred_fields 2010-01-19 12:27:14 -06:00
Harry Marr
3357b55fbf Indexing on ListFields now works properly 2010-01-16 15:35:01 +00:00