Bump to v0.3
This commit is contained in:
parent
0d89e967f2
commit
00c8d7e6f5
@ -1,6 +1,6 @@
|
|||||||
|
include MANIFEST.in
|
||||||
include README.rst
|
include README.rst
|
||||||
include LICENSE
|
include LICENSE
|
||||||
|
include AUTHORS
|
||||||
recursive-include docs *
|
recursive-include docs *
|
||||||
prune docs/_build
|
prune docs/_build
|
||||||
recursive-include tests *
|
|
||||||
recursive-exclude * *.pyc *.swp
|
|
||||||
|
10
README.rst
10
README.rst
@ -15,7 +15,7 @@ a `tutorial <http://hmarr.com/mongoengine/tutorial.html>`_, a `user guide
|
|||||||
Installation
|
Installation
|
||||||
============
|
============
|
||||||
If you have `setuptools <http://peak.telecommunity.com/DevCenter/setuptools>`_
|
If you have `setuptools <http://peak.telecommunity.com/DevCenter/setuptools>`_
|
||||||
you can use ``easy_install mongoengine``. Otherwise, you can download the
|
you can use ``easy_install -U mongoengine``. Otherwise, you can download the
|
||||||
source from `GitHub <http://github.com/hmarr/mongoengine>`_ and run ``python
|
source from `GitHub <http://github.com/hmarr/mongoengine>`_ and run ``python
|
||||||
setup.py install``.
|
setup.py install``.
|
||||||
|
|
||||||
@ -82,6 +82,14 @@ Tests
|
|||||||
To run the test suite, ensure you are running a local instance of MongoDB on
|
To run the test suite, ensure you are running a local instance of MongoDB on
|
||||||
the standard port, and run ``python setup.py test``.
|
the standard port, and run ``python setup.py test``.
|
||||||
|
|
||||||
|
Community
|
||||||
|
=========
|
||||||
|
- `MongoEngine Users mailing list
|
||||||
|
<http://groups.google.com/group/mongoengine-users>`_
|
||||||
|
- `MongoEngine Developers mailing list
|
||||||
|
<http://groups.google.com/group/mongoengine-dev>`_
|
||||||
|
- `#mongoengine IRC channel <irc://irc.freenode.net/mongoengine>`_
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
============
|
============
|
||||||
The source is available on `GitHub <http://github.com/hmarr/mongoengine>`_ - to
|
The source is available on `GitHub <http://github.com/hmarr/mongoengine>`_ - to
|
||||||
|
@ -2,6 +2,40 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
Changes in v0.3
|
||||||
|
===============
|
||||||
|
- Added MapReduce support
|
||||||
|
- Added ``contains``, ``startswith`` and ``endswith`` query operators (and
|
||||||
|
case-insensitive versions that are prefixed with 'i')
|
||||||
|
- Deprecated fields' ``name`` parameter, replaced with ``db_field``
|
||||||
|
- Added ``QuerySet.only`` for only retrieving specific fields
|
||||||
|
- Added ``QuerySet.in_bulk()`` for bulk querying using ids
|
||||||
|
- ``QuerySet``\ s now have a ``rewind()`` method, which is called automatically
|
||||||
|
when the iterator is exhausted, allowing ``QuerySet``\ s to be reused
|
||||||
|
- Added ``DictField``
|
||||||
|
- Added ``URLField``
|
||||||
|
- Added ``DecimalField``
|
||||||
|
- Added ``BinaryField``
|
||||||
|
- Added ``GenericReferenceField``
|
||||||
|
- Added ``get()`` and ``get_or_create()`` methods to ``QuerySet``
|
||||||
|
- ``ReferenceField``\ s may now reference the document they are defined on
|
||||||
|
(recursive references) and documents that have not yet been defined
|
||||||
|
- ``Document`` objects may now be compared for equality (equal if _ids are
|
||||||
|
equal and documents are of same type)
|
||||||
|
- ``QuerySet`` update methods now have an ``upsert`` parameter
|
||||||
|
- Added field name substitution for Javascript code (allows the user to use the
|
||||||
|
Python names for fields in JS, which are later substituted for the real field
|
||||||
|
names)
|
||||||
|
- ``Q`` objects now support regex querying
|
||||||
|
- Fixed bug where referenced documents within lists weren't properly
|
||||||
|
dereferenced
|
||||||
|
- ``ReferenceField``\ s may now be queried using their _id
|
||||||
|
- Fixed bug where ``EmbeddedDocuments`` couldn't be non-polymorphic
|
||||||
|
- ``queryset_manager`` functions now accept two arguments -- the document class
|
||||||
|
as the first and the queryset as the second
|
||||||
|
- Fixed bug where ``QuerySet.exec_js`` ignored ``Q`` objects
|
||||||
|
- Other minor fixes
|
||||||
|
|
||||||
Changes in v0.2.2
|
Changes in v0.2.2
|
||||||
=================
|
=================
|
||||||
- Fixed bug that prevented indexes from being used on ``ListField``\ s
|
- Fixed bug that prevented indexes from being used on ``ListField``\ s
|
||||||
|
@ -85,6 +85,8 @@ expressions:
|
|||||||
* ``endswith`` -- string field ends with value
|
* ``endswith`` -- string field ends with value
|
||||||
* ``iendswith`` -- string field ends with value (case insensitive)
|
* ``iendswith`` -- string field ends with value (case insensitive)
|
||||||
|
|
||||||
|
.. versionadded:: 0.3
|
||||||
|
|
||||||
Limiting and skipping results
|
Limiting and skipping results
|
||||||
=============================
|
=============================
|
||||||
Just as with traditional ORMs, you may limit the number of results returned, or
|
Just as with traditional ORMs, you may limit the number of results returned, or
|
||||||
|
@ -7,14 +7,16 @@ MongoDB. To install it, simply run
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
# easy_install mongoengine
|
# easy_install -U mongoengine
|
||||||
|
|
||||||
The source is available on `GitHub <http://github.com/hmarr/mongoengine>`_.
|
The source is available on `GitHub <http://github.com/hmarr/mongoengine>`_.
|
||||||
|
|
||||||
If you are interested in contributing, join the developers' `mailing list
|
To get help with using MongoEngine, use the `MongoEngine Users mailing list
|
||||||
<http://groups.google.com/group/mongoengine-dev>`_. Some of us also like to
|
<http://groups.google.com/group/mongoengine-users>`_ or come chat on the
|
||||||
hang out at `#mongoengine IRC channel <irc://irc.freenode.net/mongoengine>`_.
|
`#mongoengine IRC channel <irc://irc.freenode.net/mongoengine>`_.
|
||||||
|
|
||||||
|
If you are interested in contributing, join the developers' `mailing list
|
||||||
|
<http://groups.google.com/group/mongoengine-dev>`_.
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
@ -12,7 +12,7 @@ __all__ = (document.__all__ + fields.__all__ + connection.__all__ +
|
|||||||
|
|
||||||
__author__ = 'Harry Marr'
|
__author__ = 'Harry Marr'
|
||||||
|
|
||||||
VERSION = (0, 2, 2)
|
VERSION = (0, 3, 0)
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
version = '%s.%s' % (VERSION[0], VERSION[1])
|
version = '%s.%s' % (VERSION[0], VERSION[1])
|
||||||
|
@ -343,6 +343,8 @@ class QuerySet(object):
|
|||||||
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
|
:class:`~mongoengine.queryset.MultipleObjectsReturned` or
|
||||||
:class:`~mongoengine.queryset.DoesNotExist` exceptions if multiple or
|
:class:`~mongoengine.queryset.DoesNotExist` exceptions if multiple or
|
||||||
no results are found.
|
no results are found.
|
||||||
|
|
||||||
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
self.__call__(*q_objs, **query)
|
self.__call__(*q_objs, **query)
|
||||||
count = self.count()
|
count = self.count()
|
||||||
@ -360,6 +362,8 @@ class QuerySet(object):
|
|||||||
results are found. A new document will be created if the document
|
results are found. A new document will be created if the document
|
||||||
doesn't exists; a dictionary of default values for the new document
|
doesn't exists; a dictionary of default values for the new document
|
||||||
may be provided as a keyword argument called :attr:`defaults`.
|
may be provided as a keyword argument called :attr:`defaults`.
|
||||||
|
|
||||||
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
defaults = query.get('defaults', {})
|
defaults = query.get('defaults', {})
|
||||||
if 'defaults' in query:
|
if 'defaults' in query:
|
||||||
@ -406,6 +410,8 @@ class QuerySet(object):
|
|||||||
:param object_ids: a list or tuple of ``ObjectId``\ s
|
:param object_ids: a list or tuple of ``ObjectId``\ s
|
||||||
:rtype: dict of ObjectIds as keys and collection-specific
|
:rtype: dict of ObjectIds as keys and collection-specific
|
||||||
Document subclasses as values.
|
Document subclasses as values.
|
||||||
|
|
||||||
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
doc_map = {}
|
doc_map = {}
|
||||||
|
|
||||||
@ -428,6 +434,8 @@ class QuerySet(object):
|
|||||||
|
|
||||||
def rewind(self):
|
def rewind(self):
|
||||||
"""Rewind the cursor to its unevaluated state.
|
"""Rewind the cursor to its unevaluated state.
|
||||||
|
|
||||||
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
self._cursor.rewind()
|
self._cursor.rewind()
|
||||||
|
|
||||||
@ -470,7 +478,6 @@ class QuerySet(object):
|
|||||||
PyMongo version **>= 1.2**.
|
PyMongo version **>= 1.2**.
|
||||||
|
|
||||||
.. versionadded:: 0.3
|
.. versionadded:: 0.3
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from document import MapReduceDocument
|
from document import MapReduceDocument
|
||||||
|
|
||||||
@ -572,6 +579,8 @@ class QuerySet(object):
|
|||||||
post = BlogPost.objects(...).only("title")
|
post = BlogPost.objects(...).only("title")
|
||||||
|
|
||||||
:param fields: fields to include
|
:param fields: fields to include
|
||||||
|
|
||||||
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
self._loaded_fields = []
|
self._loaded_fields = []
|
||||||
for field in fields:
|
for field in fields:
|
||||||
|
@ -696,7 +696,7 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
post2.save()
|
post2.save()
|
||||||
post3.save()
|
post3.save()
|
||||||
|
|
||||||
self.assertEqual(BlogPost._fields['title'].name, '_id')
|
self.assertEqual(BlogPost._fields['title'].db_field, '_id')
|
||||||
self.assertEqual(BlogPost._meta['id_field'], 'title')
|
self.assertEqual(BlogPost._meta['id_field'], 'title')
|
||||||
|
|
||||||
map_f = """
|
map_f = """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user