Minor typos fixes in docs
This commit is contained in:
parent
263616ef01
commit
e0f1e79e6a
@ -71,7 +71,7 @@ Changes in 0.9.X - DEV
|
|||||||
|
|
||||||
Changes in 0.8.7
|
Changes in 0.8.7
|
||||||
================
|
================
|
||||||
- Calling reload on deleted / nonexistant documents raises DoesNotExist (#538)
|
- Calling reload on deleted / nonexistent documents raises DoesNotExist (#538)
|
||||||
- Stop ensure_indexes running on a secondaries (#555)
|
- Stop ensure_indexes running on a secondaries (#555)
|
||||||
- Fix circular import issue with django auth (#531) (#545)
|
- Fix circular import issue with django auth (#531) (#545)
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ Changes in 0.8.5
|
|||||||
- Fix multi level nested fields getting marked as changed (#523)
|
- Fix multi level nested fields getting marked as changed (#523)
|
||||||
- Django 1.6 login fix (#522) (#527)
|
- Django 1.6 login fix (#522) (#527)
|
||||||
- Django 1.6 session fix (#509)
|
- Django 1.6 session fix (#509)
|
||||||
- EmbeddedDocument._instance is now set when settng the attribute (#506)
|
- EmbeddedDocument._instance is now set when setting the attribute (#506)
|
||||||
- Fixed EmbeddedDocument with ReferenceField equality issue (#502)
|
- Fixed EmbeddedDocument with ReferenceField equality issue (#502)
|
||||||
- Fixed GenericReferenceField serialization order (#499)
|
- Fixed GenericReferenceField serialization order (#499)
|
||||||
- Fixed count and none bug (#498)
|
- Fixed count and none bug (#498)
|
||||||
@ -174,7 +174,7 @@ Changes in 0.8.0
|
|||||||
- Added `get_next_value` preview for SequenceFields (#319)
|
- Added `get_next_value` preview for SequenceFields (#319)
|
||||||
- Added no_sub_classes context manager and queryset helper (#312)
|
- Added no_sub_classes context manager and queryset helper (#312)
|
||||||
- Querysets now utilises a local cache
|
- Querysets now utilises a local cache
|
||||||
- Changed __len__ behavour in the queryset (#247, #311)
|
- Changed __len__ behaviour in the queryset (#247, #311)
|
||||||
- Fixed querying string versions of ObjectIds issue with ReferenceField (#307)
|
- Fixed querying string versions of ObjectIds issue with ReferenceField (#307)
|
||||||
- Added $setOnInsert support for upserts (#308)
|
- Added $setOnInsert support for upserts (#308)
|
||||||
- Upserts now possible with just query parameters (#309)
|
- Upserts now possible with just query parameters (#309)
|
||||||
@ -225,7 +225,7 @@ Changes in 0.8.0
|
|||||||
- Uses getlasterror to test created on updated saves (#163)
|
- Uses getlasterror to test created on updated saves (#163)
|
||||||
- Fixed inheritance and unique index creation (#140)
|
- Fixed inheritance and unique index creation (#140)
|
||||||
- Fixed reverse delete rule with inheritance (#197)
|
- Fixed reverse delete rule with inheritance (#197)
|
||||||
- Fixed validation for GenericReferences which havent been dereferenced
|
- Fixed validation for GenericReferences which haven't been dereferenced
|
||||||
- Added switch_db context manager (#106)
|
- Added switch_db context manager (#106)
|
||||||
- Added switch_db method to document instances (#106)
|
- Added switch_db method to document instances (#106)
|
||||||
- Added no_dereference context manager (#82) (#61)
|
- Added no_dereference context manager (#82) (#61)
|
||||||
@ -307,11 +307,11 @@ Changes in 0.7.2
|
|||||||
- Update index spec generation so its not destructive (#113)
|
- Update index spec generation so its not destructive (#113)
|
||||||
|
|
||||||
Changes in 0.7.1
|
Changes in 0.7.1
|
||||||
=================
|
================
|
||||||
- Fixed index spec inheritance (#111)
|
- Fixed index spec inheritance (#111)
|
||||||
|
|
||||||
Changes in 0.7.0
|
Changes in 0.7.0
|
||||||
=================
|
================
|
||||||
- Updated queryset.delete so you can use with skip / limit (#107)
|
- Updated queryset.delete so you can use with skip / limit (#107)
|
||||||
- Updated index creation allows kwargs to be passed through refs (#104)
|
- Updated index creation allows kwargs to be passed through refs (#104)
|
||||||
- Fixed Q object merge edge case (#109)
|
- Fixed Q object merge edge case (#109)
|
||||||
@ -392,7 +392,7 @@ Changes in 0.6.12
|
|||||||
- Fixes error with _delta handling DBRefs
|
- Fixes error with _delta handling DBRefs
|
||||||
|
|
||||||
Changes in 0.6.11
|
Changes in 0.6.11
|
||||||
==================
|
=================
|
||||||
- Fixed inconsistency handling None values field attrs
|
- Fixed inconsistency handling None values field attrs
|
||||||
- Fixed map_field embedded db_field issue
|
- Fixed map_field embedded db_field issue
|
||||||
- Fixed .save() _delta issue with DbRefs
|
- Fixed .save() _delta issue with DbRefs
|
||||||
@ -472,7 +472,7 @@ Changes in 0.6.1
|
|||||||
- Fix for replicaSet connections
|
- Fix for replicaSet connections
|
||||||
|
|
||||||
Changes in 0.6
|
Changes in 0.6
|
||||||
================
|
==============
|
||||||
|
|
||||||
- Added FutureWarning to inherited classes not declaring 'allow_inheritance' as the default will change in 0.7
|
- Added FutureWarning to inherited classes not declaring 'allow_inheritance' as the default will change in 0.7
|
||||||
- Added support for covered indexes when inheritance is off
|
- Added support for covered indexes when inheritance is off
|
||||||
@ -560,8 +560,8 @@ Changes in v0.5
|
|||||||
- Updated default collection naming convention
|
- Updated default collection naming convention
|
||||||
- Added Document Mixin support
|
- Added Document Mixin support
|
||||||
- Fixed queryet __repr__ mid iteration
|
- Fixed queryet __repr__ mid iteration
|
||||||
- Added hint() support, so cantell Mongo the proper index to use for the query
|
- Added hint() support, so can tell Mongo the proper index to use for the query
|
||||||
- Fixed issue with inconsitent setting of _cls breaking inherited referencing
|
- Fixed issue with inconsistent setting of _cls breaking inherited referencing
|
||||||
- Added help_text and verbose_name to fields to help with some form libs
|
- Added help_text and verbose_name to fields to help with some form libs
|
||||||
- Updated item_frequencies to handle embedded document lookups
|
- Updated item_frequencies to handle embedded document lookups
|
||||||
- Added delta tracking now only sets / unsets explicitly changed fields
|
- Added delta tracking now only sets / unsets explicitly changed fields
|
||||||
|
@ -23,14 +23,14 @@ arguments should be provided::
|
|||||||
|
|
||||||
connect('project1', username='webapp', password='pwd123')
|
connect('project1', username='webapp', password='pwd123')
|
||||||
|
|
||||||
Uri style connections are also supported - just supply the uri as
|
URI style connections are also supported - just supply the uri as
|
||||||
the :attr:`host` to
|
the :attr:`host` to
|
||||||
:func:`~mongoengine.connect`::
|
:func:`~mongoengine.connect`::
|
||||||
|
|
||||||
connect('project1', host='mongodb://localhost/database_name')
|
connect('project1', host='mongodb://localhost/database_name')
|
||||||
|
|
||||||
Note that database name from uri has priority over name
|
Note that database name from uri has priority over name
|
||||||
in ::func:`~mongoengine.connect`
|
in :func:`~mongoengine.connect`
|
||||||
|
|
||||||
ReplicaSets
|
ReplicaSets
|
||||||
===========
|
===========
|
||||||
@ -115,3 +115,4 @@ access to the same Group document across collection::
|
|||||||
|
|
||||||
with switch_collection(Group, 'group2000') as Group:
|
with switch_collection(Group, 'group2000') as Group:
|
||||||
Group(name="hello Group 2000 collection!").save() # Saves in group2000 collection
|
Group(name="hello Group 2000 collection!").save() # Saves in group2000 collection
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ Its value can take any of the following constants:
|
|||||||
Any object's fields still referring to the object being deleted are removed
|
Any object's fields still referring to the object being deleted are removed
|
||||||
(using MongoDB's "unset" operation), effectively nullifying the relationship.
|
(using MongoDB's "unset" operation), effectively nullifying the relationship.
|
||||||
:const:`mongoengine.CASCADE`
|
:const:`mongoengine.CASCADE`
|
||||||
Any object containing fields that are refererring to the object being deleted
|
Any object containing fields that are referring to the object being deleted
|
||||||
are deleted first.
|
are deleted first.
|
||||||
:const:`mongoengine.PULL`
|
:const:`mongoengine.PULL`
|
||||||
Removes the reference to the object (using MongoDB's "pull" operation)
|
Removes the reference to the object (using MongoDB's "pull" operation)
|
||||||
@ -428,7 +428,7 @@ Document collections
|
|||||||
====================
|
====================
|
||||||
Document classes that inherit **directly** from :class:`~mongoengine.Document`
|
Document classes that inherit **directly** from :class:`~mongoengine.Document`
|
||||||
will have their own **collection** in the database. The name of the collection
|
will have their own **collection** in the database. The name of the collection
|
||||||
is by default the name of the class, coverted to lowercase (so in the example
|
is by default the name of the class, converted to lowercase (so in the example
|
||||||
above, the collection would be called `page`). If you need to change the name
|
above, the collection would be called `page`). If you need to change the name
|
||||||
of the collection (e.g. to use MongoEngine with an existing database), then
|
of the collection (e.g. to use MongoEngine with an existing database), then
|
||||||
create a class dictionary attribute called :attr:`meta` on your document, and
|
create a class dictionary attribute called :attr:`meta` on your document, and
|
||||||
@ -664,11 +664,11 @@ Shard keys
|
|||||||
==========
|
==========
|
||||||
|
|
||||||
If your collection is sharded, then you need to specify the shard key as a tuple,
|
If your collection is sharded, then you need to specify the shard key as a tuple,
|
||||||
using the :attr:`shard_key` attribute of :attr:`-mongoengine.Document.meta`.
|
using the :attr:`shard_key` attribute of :attr:`~mongoengine.Document.meta`.
|
||||||
This ensures that the shard key is sent with the query when calling the
|
This ensures that the shard key is sent with the query when calling the
|
||||||
:meth:`~mongoengine.document.Document.save` or
|
:meth:`~mongoengine.document.Document.save` or
|
||||||
:meth:`~mongoengine.document.Document.update` method on an existing
|
:meth:`~mongoengine.document.Document.update` method on an existing
|
||||||
:class:`-mongoengine.Document` instance::
|
:class:`~mongoengine.Document` instance::
|
||||||
|
|
||||||
class LogEntry(Document):
|
class LogEntry(Document):
|
||||||
machine = StringField()
|
machine = StringField()
|
||||||
|
@ -17,7 +17,7 @@ fetch documents from the database::
|
|||||||
|
|
||||||
As of MongoEngine 0.8 the querysets utilise a local cache. So iterating
|
As of MongoEngine 0.8 the querysets utilise a local cache. So iterating
|
||||||
it multiple times will only cause a single query. If this is not the
|
it multiple times will only cause a single query. If this is not the
|
||||||
desired behavour you can call :class:`~mongoengine.QuerySet.no_cache`
|
desired behaviour you can call :class:`~mongoengine.QuerySet.no_cache`
|
||||||
(version **0.8.3+**) to return a non-caching queryset.
|
(version **0.8.3+**) to return a non-caching queryset.
|
||||||
|
|
||||||
Filtering queries
|
Filtering queries
|
||||||
@ -252,7 +252,7 @@ To retrieve a result that should be unique in the collection, use
|
|||||||
no document matches the query, and
|
no document matches the query, and
|
||||||
:class:`~mongoengine.queryset.MultipleObjectsReturned`
|
:class:`~mongoengine.queryset.MultipleObjectsReturned`
|
||||||
if more than one document matched the query. These exceptions are merged into
|
if more than one document matched the query. These exceptions are merged into
|
||||||
your document defintions eg: `MyDoc.DoesNotExist`
|
your document definitions eg: `MyDoc.DoesNotExist`
|
||||||
|
|
||||||
A variation of this method exists,
|
A variation of this method exists,
|
||||||
:meth:`~mongoengine.queryset.Queryset.get_or_create`, that will create a new
|
:meth:`~mongoengine.queryset.Queryset.get_or_create`, that will create a new
|
||||||
@ -658,3 +658,4 @@ following example shows how the substitutions are made::
|
|||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ Upgrading
|
|||||||
0.8.7
|
0.8.7
|
||||||
*****
|
*****
|
||||||
|
|
||||||
Calling reload on deleted / nonexistant documents now raises a DoesNotExist
|
Calling reload on deleted / nonexistent documents now raises a DoesNotExist
|
||||||
exception.
|
exception.
|
||||||
|
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ update your code like so: ::
|
|||||||
[m for m in mammals] # This will return all carnivores
|
[m for m in mammals] # This will return all carnivores
|
||||||
|
|
||||||
Len iterates the queryset
|
Len iterates the queryset
|
||||||
--------------------------
|
-------------------------
|
||||||
|
|
||||||
If you ever did `len(queryset)` it previously did a `count()` under the covers,
|
If you ever did `len(queryset)` it previously did a `count()` under the covers,
|
||||||
this caused some unusual issues. As `len(queryset)` is most often used by
|
this caused some unusual issues. As `len(queryset)` is most often used by
|
||||||
|
@ -692,7 +692,7 @@ class BaseDocument(object):
|
|||||||
|
|
||||||
spec_fields = [v['fields']
|
spec_fields = [v['fields']
|
||||||
for k, v in enumerate(index_specs)]
|
for k, v in enumerate(index_specs)]
|
||||||
# Merge unqiue_indexes with existing specs
|
# Merge unique_indexes with existing specs
|
||||||
for k, v in enumerate(indices):
|
for k, v in enumerate(indices):
|
||||||
if v['fields'] in spec_fields:
|
if v['fields'] in spec_fields:
|
||||||
index_specs[spec_fields.index(v['fields'])].update(v)
|
index_specs[spec_fields.index(v['fields'])].update(v)
|
||||||
|
@ -677,7 +677,7 @@ class Document(BaseDocument):
|
|||||||
if cls._meta.get('abstract'):
|
if cls._meta.get('abstract'):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# get all the base classes, subclasses and sieblings
|
# get all the base classes, subclasses and siblings
|
||||||
classes = []
|
classes = []
|
||||||
|
|
||||||
def get_classes(cls):
|
def get_classes(cls):
|
||||||
|
@ -291,7 +291,7 @@ class DecimalField(BaseField):
|
|||||||
:param max_value: Validation rule for the maximum acceptable value.
|
:param max_value: Validation rule for the maximum acceptable value.
|
||||||
:param force_string: Store as a string.
|
:param force_string: Store as a string.
|
||||||
:param precision: Number of decimal places to store.
|
:param precision: Number of decimal places to store.
|
||||||
:param rounding: The rounding rule from the python decimal libary:
|
:param rounding: The rounding rule from the python decimal library:
|
||||||
|
|
||||||
- decimal.ROUND_CEILING (towards Infinity)
|
- decimal.ROUND_CEILING (towards Infinity)
|
||||||
- decimal.ROUND_DOWN (towards zero)
|
- decimal.ROUND_DOWN (towards zero)
|
||||||
@ -375,11 +375,11 @@ class DateTimeField(BaseField):
|
|||||||
|
|
||||||
Uses the python-dateutil library if available alternatively use time.strptime
|
Uses the python-dateutil library if available alternatively use time.strptime
|
||||||
to parse the dates. Note: python-dateutil's parser is fully featured and when
|
to parse the dates. Note: python-dateutil's parser is fully featured and when
|
||||||
installed you can utilise it to convert varing types of date formats into valid
|
installed you can utilise it to convert varying types of date formats into valid
|
||||||
python datetime objects.
|
python datetime objects.
|
||||||
|
|
||||||
Note: Microseconds are rounded to the nearest millisecond.
|
Note: Microseconds are rounded to the nearest millisecond.
|
||||||
Pre UTC microsecond support is effecively broken.
|
Pre UTC microsecond support is effectively broken.
|
||||||
Use :class:`~mongoengine.fields.ComplexDateTimeField` if you
|
Use :class:`~mongoengine.fields.ComplexDateTimeField` if you
|
||||||
need accurate microsecond support.
|
need accurate microsecond support.
|
||||||
"""
|
"""
|
||||||
@ -638,7 +638,7 @@ class DynamicField(BaseField):
|
|||||||
Used by :class:`~mongoengine.DynamicDocument` to handle dynamic data"""
|
Used by :class:`~mongoengine.DynamicDocument` to handle dynamic data"""
|
||||||
|
|
||||||
def to_mongo(self, value):
|
def to_mongo(self, value):
|
||||||
"""Convert a Python type to a MongoDBcompatible type.
|
"""Convert a Python type to a MongoDB compatible type.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, basestring):
|
||||||
@ -1649,7 +1649,7 @@ class ImageField(FileField):
|
|||||||
|
|
||||||
class SequenceField(BaseField):
|
class SequenceField(BaseField):
|
||||||
|
|
||||||
"""Provides a sequental counter see:
|
"""Provides a sequential counter see:
|
||||||
http://www.mongodb.org/display/DOCS/Object+IDs#ObjectIDs-SequenceNumbers
|
http://www.mongodb.org/display/DOCS/Object+IDs#ObjectIDs-SequenceNumbers
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@ -1750,7 +1750,7 @@ class SequenceField(BaseField):
|
|||||||
|
|
||||||
def prepare_query_value(self, op, value):
|
def prepare_query_value(self, op, value):
|
||||||
"""
|
"""
|
||||||
This method is overriden in order to convert the query value into to required
|
This method is overridden in order to convert the query value into to required
|
||||||
type. We need to do this in order to be able to successfully compare query
|
type. We need to do this in order to be able to successfully compare query
|
||||||
values passed as string, the base implementation returns the value as is.
|
values passed as string, the base implementation returns the value as is.
|
||||||
"""
|
"""
|
||||||
|
@ -272,7 +272,7 @@ class BaseQuerySet(object):
|
|||||||
.. note:: This requires two separate operations and therefore a
|
.. note:: This requires two separate operations and therefore a
|
||||||
race condition exists. Because there are no transactions in
|
race condition exists. Because there are no transactions in
|
||||||
mongoDB other approaches should be investigated, to ensure you
|
mongoDB other approaches should be investigated, to ensure you
|
||||||
don't accidently duplicate data when using this method. This is
|
don't accidentally duplicate data when using this method. This is
|
||||||
now scheduled to be removed before 1.0
|
now scheduled to be removed before 1.0
|
||||||
|
|
||||||
:param write_concern: optional extra keyword arguments used if we
|
:param write_concern: optional extra keyword arguments used if we
|
||||||
@ -992,8 +992,8 @@ class BaseQuerySet(object):
|
|||||||
|
|
||||||
def aggregate(self, *pipeline, **kwargs):
|
def aggregate(self, *pipeline, **kwargs):
|
||||||
"""
|
"""
|
||||||
Perform a aggreggate function based in your queryset params
|
Perform a aggregate function based in your queryset params
|
||||||
:param pipeline: list of agreggation commands,
|
:param pipeline: list of aggregation commands,
|
||||||
see: http://docs.mongodb.org/manual/core/aggregation-pipeline/
|
see: http://docs.mongodb.org/manual/core/aggregation-pipeline/
|
||||||
|
|
||||||
.. versionadded:: 0.9
|
.. versionadded:: 0.9
|
||||||
|
@ -29,7 +29,7 @@ class DuplicateQueryConditionsError(InvalidQueryError):
|
|||||||
|
|
||||||
|
|
||||||
class SimplificationVisitor(QNodeVisitor):
|
class SimplificationVisitor(QNodeVisitor):
|
||||||
"""Simplifies query trees by combinging unnecessary 'and' connection nodes
|
"""Simplifies query trees by combining unnecessary 'and' connection nodes
|
||||||
into a single Q-object.
|
into a single Q-object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user