Reformat repo with pre-commit hooks
This commit is contained in:
		| @@ -13,7 +13,7 @@ Help Wanted! | ||||
|  | ||||
| The MongoEngine team is looking for help contributing and maintaining a new | ||||
| Django extension for MongoEngine! If you have Django experience and would like | ||||
| to help contribute to the project, please get in touch on the  | ||||
| `mailing list <http://groups.google.com/group/mongoengine-users>`_ or by  | ||||
| to help contribute to the project, please get in touch on the | ||||
| `mailing list <http://groups.google.com/group/mongoengine-users>`_ or by | ||||
| simply contributing on | ||||
| `GitHub <https://github.com/MongoEngine/django-mongoengine>`_. | ||||
|   | ||||
| @@ -10,4 +10,3 @@ If this is a requirement for your project, check the alternative:  `uMongo`_ and | ||||
|  | ||||
| .. _uMongo: https://umongo.readthedocs.io/ | ||||
| .. _MotorEngine: https://motorengine.readthedocs.io/ | ||||
|  | ||||
|   | ||||
| @@ -86,7 +86,7 @@ using 3 different databases to store data:: | ||||
|         connect(alias='user-db-alias', db='user-db') | ||||
|         connect(alias='book-db-alias', db='book-db') | ||||
|         connect(alias='users-books-db-alias', db='users-books-db') | ||||
|          | ||||
|  | ||||
|         class User(Document): | ||||
|             name = StringField() | ||||
|  | ||||
|   | ||||
| @@ -2,10 +2,10 @@ | ||||
| Use mongomock for testing | ||||
| ============================== | ||||
|  | ||||
| `mongomock <https://github.com/vmalloc/mongomock/>`_ is a package to do just  | ||||
| `mongomock <https://github.com/vmalloc/mongomock/>`_ is a package to do just | ||||
| what the name implies, mocking a mongo database. | ||||
|  | ||||
| To use with mongoengine, simply specify mongomock when connecting with  | ||||
| To use with mongoengine, simply specify mongomock when connecting with | ||||
| mongoengine: | ||||
|  | ||||
| .. code-block:: python | ||||
|   | ||||
| @@ -44,8 +44,8 @@ Available signals include: | ||||
|  | ||||
| `post_save` | ||||
|   Called within :meth:`~mongoengine.Document.save` after most actions | ||||
|   (validation, insert/update, and cascades, but not clearing dirty flags) have  | ||||
|   completed successfully.  Passed the additional boolean keyword argument  | ||||
|   (validation, insert/update, and cascades, but not clearing dirty flags) have | ||||
|   completed successfully.  Passed the additional boolean keyword argument | ||||
|   `created` to indicate if the save was an insert or an update. | ||||
|  | ||||
| `pre_delete` | ||||
|   | ||||
| @@ -8,7 +8,7 @@ After MongoDB 2.4 version, supports search documents by text indexes. | ||||
| Defining a Document with text index | ||||
| =================================== | ||||
| Use the *$* prefix to set a text index, Look the declaration:: | ||||
|    | ||||
|  | ||||
|   class News(Document): | ||||
|       title = StringField() | ||||
|       content = StringField() | ||||
| @@ -35,10 +35,10 @@ Saving a document:: | ||||
|        content="Various improvements").save() | ||||
|  | ||||
| Next, start a text search using :attr:`QuerySet.search_text` method:: | ||||
|    | ||||
|  | ||||
|   document = News.objects.search_text('testing').first() | ||||
|   document.title # may be: "Using mongodb text search" | ||||
|    | ||||
|  | ||||
|   document = News.objects.search_text('released').first() | ||||
|   document.title # may be: "MongoEngine 0.9 released" | ||||
|  | ||||
|   | ||||
| @@ -91,4 +91,3 @@ Indices and tables | ||||
| * :ref:`genindex` | ||||
| * :ref:`modindex` | ||||
| * :ref:`search` | ||||
|  | ||||
|   | ||||
| @@ -1193,7 +1193,9 @@ class BaseQuerySet(object): | ||||
|         validate_read_preference("read_preference", read_preference) | ||||
|         queryset = self.clone() | ||||
|         queryset._read_preference = read_preference | ||||
|         queryset._cursor_obj = None  # we need to re-create the cursor object whenever we apply read_preference | ||||
|         queryset._cursor_obj = ( | ||||
|             None | ||||
|         )  # we need to re-create the cursor object whenever we apply read_preference | ||||
|         return queryset | ||||
|  | ||||
|     def scalar(self, *fields): | ||||
|   | ||||
| @@ -51,4 +51,4 @@ rm -rf $RPM_BUILD_ROOT | ||||
| # %{python_sitearch}/* | ||||
|  | ||||
| %changelog | ||||
| * See: http://docs.mongoengine.org/en/latest/changelog.html | ||||
| * See: http://docs.mongoengine.org/en/latest/changelog.html | ||||
|   | ||||
		Reference in New Issue
	
	Block a user