Updated docs

This commit is contained in:
Ross Lawley 2012-11-08 16:40:58 +00:00
parent f265915aa2
commit dfdc0d92c3
3 changed files with 5 additions and 5 deletions

View File

@ -597,7 +597,7 @@ Working with existing data
As MongoEngine no longer defaults to needing :attr:`_cls` you can quickly and As MongoEngine no longer defaults to needing :attr:`_cls` you can quickly and
easily get working with existing data. Just define the document to match easily get working with existing data. Just define the document to match
the expected schema in your database. If you have wildly varying schemas then the expected schema in your database. If you have wildly varying schemas then
a :class:`~mongoengine.DynamicDocument` might be more appropriate. a :class:`~mongoengine.DynamicDocument` might be more appropriate. ::
# Will work with data in an existing collection named 'cmsPage' # Will work with data in an existing collection named 'cmsPage'
class Page(Document): class Page(Document):

View File

@ -64,7 +64,7 @@ document values for example::
.. note:: .. note::
Cleaning is only called if validation is turned on and when calling Cleaning is only called if validation is turned on and when calling
:meth:`~mongoengine.Document.save`. :meth:`~mongoengine.Document.save`.
Cascading Saves Cascading Saves
--------------- ---------------

View File

@ -14,7 +14,7 @@ Data Model
The inheritance model has changed, we no longer need to store an array of The inheritance model has changed, we no longer need to store an array of
:attr:`types` with the model we can just use the classname in :attr:`_cls`. :attr:`types` with the model we can just use the classname in :attr:`_cls`.
This means that you will have to update your indexes for each of your This means that you will have to update your indexes for each of your
inherited classes like so: inherited classes like so: ::
# 1. Declaration of the class # 1. Declaration of the class
class Animal(Document): class Animal(Document):
@ -49,7 +49,7 @@ Document Definition
The default for inheritance has changed - its now off by default and The default for inheritance has changed - its now off by default and
:attr:`_cls` will not be stored automatically with the class. So if you extend :attr:`_cls` will not be stored automatically with the class. So if you extend
your :class:`~mongoengine.Document` or :class:`~mongoengine.EmbeddedDocuments` your :class:`~mongoengine.Document` or :class:`~mongoengine.EmbeddedDocuments`
you will need to declare :attr:`allow_inheritance` in the meta data like so: you will need to declare :attr:`allow_inheritance` in the meta data like so: ::
class Animal(Document): class Animal(Document):
name = StringField() name = StringField()
@ -67,7 +67,7 @@ They should be replaced with :func:`~mongoengine.Document.ensure_indexes` /
SequenceFields SequenceFields
-------------- --------------
:class:`~mongoengine.fields.SequenceField`s now inherit from `BaseField` to :class:`~mongoengine.fields.SequenceField` now inherits from `BaseField` to
allow flexible storage of the calculated value. As such MIN and MAX settings allow flexible storage of the calculated value. As such MIN and MAX settings
are no longer handled. are no longer handled.