Skip to content

DOCSP-46866: Cleanup #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b6e726d
DOCSP-46866: Cleanup
norareidy Jan 28, 2025
c2bd528
test intersphinx
norareidy Jan 28, 2025
3773f3c
link
norareidy Jan 28, 2025
2c6b517
test
norareidy Jan 28, 2025
6761c1f
another test
norareidy Jan 28, 2025
6d525b3
maybe
norareidy Jan 28, 2025
6f1cb6f
remove second link
norareidy Jan 28, 2025
4e5ef03
snooty
norareidy Jan 28, 2025
faead26
go back
norareidy Jan 28, 2025
9d3d5ba
remove link
norareidy Jan 28, 2025
587330f
didn't work
norareidy Jan 28, 2025
4848f5e
more cleanup
norareidy Jan 28, 2025
abbf2db
try link again
norareidy Jan 28, 2025
2cc10db
more api links
norareidy Jan 28, 2025
aee2395
links
norareidy Jan 28, 2025
49f639b
test
norareidy Jan 28, 2025
1766926
another test
norareidy Jan 28, 2025
6f10dcf
another
norareidy Jan 28, 2025
ede0d4d
try
norareidy Jan 28, 2025
291ec54
links
norareidy Jan 28, 2025
ada3826
test
norareidy Jan 28, 2025
c02c87c
links
norareidy Jan 28, 2025
870f278
fixes
norareidy Jan 28, 2025
394dcd3
tests
norareidy Jan 28, 2025
2651304
links
norareidy Jan 29, 2025
45edee1
edits
norareidy Jan 29, 2025
1aff09e
fix
norareidy Jan 29, 2025
2774a99
jib feedback
norareidy Jan 30, 2025
77a0ab3
monospace
norareidy Jan 30, 2025
5468bbb
imagefield
norareidy Jan 30, 2025
0a2f701
RM feedback
norareidy Jan 30, 2025
fb2645c
small edits
norareidy Jan 31, 2025
b3a18e9
Merge remote-tracking branch 'upstream/master' into DOCSP-46866-cleanup
norareidy Jan 31, 2025
86596ca
award class fix
norareidy Jan 31, 2025
b7a9118
wording
norareidy Jan 31, 2025
6bbdc82
fix link
norareidy Jan 31, 2025
e7d69e6
adjust code highlight
norareidy Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title = "Django MongoDB Backend"

intersphinx = [ "https://www.mongodb.com/docs/manual/objects.inv",
"https://www.mongodb.com/docs/atlas/objects.inv",
"http://docs.djangoproject.com/en/5.0/_objects/"
"http://docs.djangoproject.com/en/5.0/_objects",
]

toc_landing_pages = [
Expand Down
2 changes: 1 addition & 1 deletion source/compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ MongoDB Compatibility
{+django-odm+} uses the PyMongo driver to interact with MongoDB. The {+mdb-server+}
versions that your application supports depend on your PyMongo version.
To view PyMongo and {+mdb-server+} compatibility information, see `MongoDB Compatibility
<https://www.mongodb.com/docs/languages/python/pymongo-driver/current/compatibility/#mongodb-compatibility>`__
<{+pymongo-docs+}/compatibility/#mongodb-compatibility>`__
in the PyMongo documentation.

PyMongo Compatibility
Expand Down
8 changes: 4 additions & 4 deletions source/connect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ function accepts the following arguments:
- ``conn_max_age``: Configures persistent database connections.
This argument is optional. To learn more, see
`Persistent connections <{+django-docs+}/ref/databases/#persistent-database-connections>`__
in the Django documentation.
in the {+framework+} documentation.
- ``test``: Provides a dictionary of settings for test
databases. This argument is optional. To learn more, see
`the TEST setting <{+django-docs+}/ref/settings/#test>`__
in the Django documentation.
in the {+framework+} documentation.

Example
```````
Expand All @@ -175,5 +175,5 @@ To view a sample project that configures a MongoDB database connection,
see the :ref:`django-get-started-connect` step in the Getting Started
tutorial.

To learn more about Django settings, see `Settings <{+django-docs+}/ref/settings/>`__
in the Django documentation.
To learn more about {+framework+} settings, see `Settings <{+django-docs+}/ref/settings/>`__
in the {+framework+} documentation.
8 changes: 4 additions & 4 deletions source/get-started.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Get Started with {+django-odm+}
:values: tutorial

.. meta::
:description: Learn how to create an app to connect to a MongoDB deployment by using Django MongoDB Backend.
:description: Learn how to create an app to connect to a MongoDB deployment by using {+framework+} MongoDB Backend.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using variables in the meta descriptions?

Copy link
Collaborator Author

@norareidy norareidy Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought they didn't render correctly but just checked and they do! So I'll update the descriptions

:keywords: quick start, tutorial, basics

.. toctree::
Expand All @@ -30,8 +30,8 @@ Get Started with {+django-odm+}
Create an Admin Site </get-started/create-admin/>
Next Steps </get-started/next-steps/>

{+django-odm+} is a Django database backend that uses PyMongo to connect
to MongoDB. This tutorial shows you how to create a Django app, connect to
{+django-odm+} is a {+framework+} database backend that uses PyMongo to connect
to MongoDB. This tutorial shows you how to create a {+framework+} app, connect to
a MongoDB cluster hosted on MongoDB Atlas, and interact with data in your cluster.

.. tip::
Expand All @@ -40,5 +40,5 @@ a MongoDB cluster hosted on MongoDB Atlas, and interact with data in your cluste
deployments. You can create your own free (no credit card required) MongoDB Atlas
deployment by following the steps in this guide.

Follow this tutorial to connect a sample Django application to a MongoDB Atlas
Follow this tutorial to connect a sample {+framework+} application to a MongoDB Atlas
deployment.
12 changes: 6 additions & 6 deletions source/get-started/connect-mongodb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Configure your MongoDB Connection
:keywords: app, odm, code example

After installing {+django-odm+} and creating a MongoDB Atlas deployment,
you can create a Django project that connects to MongoDB.
you can create a {+framework+} project that connects to MongoDB.

.. procedure::
:style: connected

.. step:: Create a Django project
.. step:: Create a {+framework+} project

From your shell, run the following command to create a
new Django project called ``quickstart`` based on a custom template:
Expand All @@ -28,11 +28,11 @@ you can create a Django project that connects to MongoDB.

.. note:: Project Template

The ``django-mongodb-project`` template resembles the default Django project
The ``django-mongodb-project`` template resembles the default {+framework+} project
template but makes the following changes:

- Includes MongoDB-specific migrations
- Modifies the ``settings.py`` file to instruct Django
- Modifies the ``settings.py`` file to instruct {+framework+}
to use an ``ObjectId`` value as each model's primary key

After running this command, your ``quickstart`` project has
Expand Down Expand Up @@ -69,7 +69,7 @@ you can create a Django project that connects to MongoDB.

Replace the ``<connection string URI>`` placeholder with the connection string
that you copied from the :ref:`django-get-started-connection-string`
step of this guide. This configures your Django app to connect to
step of this guide. This configures your {+framework+} app to connect to
your Atlas deployment and access the ``sample_mflix`` sample database.

.. step:: Start the server
Expand All @@ -84,5 +84,5 @@ you can create a Django project that connects to MongoDB.
Then, visit http://127.0.0.1:8000/. This page displays a "Congratulations!"
message and an image of a rocket.

After completing these steps, you have a Django project configured
After completing these steps, you have a {+framework+} project configured
to use MongoDB.
9 changes: 3 additions & 6 deletions source/get-started/connection-string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ The connection string includes the hostname or IP address and
port of your deployment, the authentication mechanism, user credentials
when applicable, and connection options.

To connect to an instance or deployment not hosted on Atlas, see
:ref:`pymongo-connection-targets` in the PyMongo documentation.

.. procedure::
:style: connected

Expand Down Expand Up @@ -52,9 +49,9 @@ To connect to an instance or deployment not hosted on Atlas, see
.. code-block:: none
:copyable: false

mongodb+srv://<username>:<password>@samplecluster.jkiff1s.mongodb.net/?retryWrites=true&w=majority&appName=SampleCluster
mongodb+srv://<db_username>:<db_password>@samplecluster.ojeyz.mongodb.net/?retryWrites=true&w=majority&appName=SampleCluster

Replace the ``<username>`` and ``<password>`` placeholders with
Replace the ``<db_username>`` and ``<db_password>`` placeholders with
your database user's username and password.

.. step:: Add a database to your connection string
Expand All @@ -65,7 +62,7 @@ To connect to an instance or deployment not hosted on Atlas, see
.. code-block:: none
:copyable: false

mongodb+srv://<username>:<password>@samplecluster.jkiff1s.mongodb.net/<database name>?retryWrites=true&w=majority&appName=SampleCluster
mongodb+srv://<db_username>:<db_password>@samplecluster.ojeyz.mongodb.net/<database name>?retryWrites=true&w=majority&appName=SampleCluster

Replace the ``<database name>`` placeholder with ``sample_mflix`` to
configure a connection to the ``sample_mflix`` Atlas sample database.
Expand Down
10 changes: 5 additions & 5 deletions source/get-started/create-admin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Create an Admin Site
.. meta::
:keywords: app, odm, code example

You can create a Django admin site to edit your application's
data from a web interface. To learn more about the Django admin
You can create a {+framework+} admin site to edit your application's
data from a web interface. To learn more about the {+framework+} admin
site and its features, see `The Django admin site <https://docs.djangoproject.com/en/{+django-version-number+}/ref/contrib/admin/>`__
in the Django documentation.
in the {+framework+} documentation.

.. procedure::
:style: connected
Expand Down Expand Up @@ -59,7 +59,7 @@ in the Django documentation.
screen:

.. figure:: /includes/figures/django_admin_login.png
:alt: The login screen on the Django admin page.
:alt: The login screen on the {+framework+} admin page.

Enter the username and password created in the previous step to log in to
the site.
Expand Down Expand Up @@ -126,5 +126,5 @@ in the Django documentation.
Then, click the :guilabel:`SAVE` button below the viewer's
information to save your changes.

After completing these steps, you can access the Django
After completing these steps, you can access the {+framework+}
admin site and use it to edit your ``Viewer`` objects.
3 changes: 2 additions & 1 deletion source/get-started/create-app.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ To learn more about the ``sample_mflix`` database, see :atlas:`Sample Mflix Data
The ``django-mongodb-app`` template ensures that your ``app.py`` file
includes the line ``"default_auto_field = 'django_mongodb_backend.fields.ObjectIdAutoField'"``.

.. step:: Create models for movie, awards, and viewer data
.. step:: Create models for movie, award, and viewer data

Open the ``models.py`` file in the ``sample_mflix`` directory and replace
its contents with the following code:
Expand Down Expand Up @@ -121,6 +121,7 @@ To learn more about the ``sample_mflix`` database, see :atlas:`Sample Mflix Data
``INSTALLED_APPS`` setting to resemble the following code:

.. code-block:: python
:emphasize-lines: 2

INSTALLED_APPS = [
'sample_mflix.apps.SampleMflixConfig',
Expand Down
2 changes: 1 addition & 1 deletion source/get-started/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ in your development environment.
This command also installs the following dependencies:

- PyMongo version {+pymongo-version+} and its dependencies
- Latest Django {+django-version+}.x version and its dependencies
- Latest {+framework+} {+django-version+}.x version and its dependencies

After you complete these steps, you have {+django-odm+} and its
dependencies installed in your development environment.
2 changes: 1 addition & 1 deletion source/get-started/next-steps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Next Steps

Congratulations on completing the {+django-odm+} tutorial!

In this tutorial, you created a Django application that
In this tutorial, you created a {+framework+} application that
connects to a MongoDB deployment hosted on MongoDB Atlas
and interacts with data.

Expand Down
4 changes: 2 additions & 2 deletions source/get-started/query-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ to read data from the ``sample_mflix`` database.
.. procedure::
:style: connected

.. step:: Query the "users" collection for a specified email
.. step:: Query the users collection for a specified email
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the removal of quotes? Should this be Users instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually we format collection names without quotes, monospaced (like here). But we also don't use monospace text in headers. However since this is a step, not a header, I'll change to users collection


Start a Python shell by running the following command:

Expand All @@ -42,7 +42,7 @@ to read data from the ``sample_mflix`` database.

<Viewer: Khal Drogo>

.. step:: Query the "movies" collection for specified runtime values
.. step:: Query the movies collection for specified runtime values
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above


Run the following code to query the ``sample_mflix.movies``
collection for movies that have a ``runtime`` value less than
Expand Down
2 changes: 1 addition & 1 deletion source/get-started/write-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ and delete functions on your model objects.
:language: python
:copyable:

.. step:: Insert a movie into the database
.. step:: Insert a Movie into the database
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this stay lowercase since it's not a proper noun?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Movie objects are capitalized; I'll add "object" after to make that clear


Run the following code to create an ``Movie`` object that
stores data about a movie titled ``"Minari"``, including
Expand Down
Binary file modified source/includes/figures/atlas_connection_connect_cluster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified source/includes/figures/atlas_connection_copy_string_python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions source/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Introduction
------------

Welcome to the documentation site for the official {+django-odm+},
a Django database backend that uses PyMongo to connect to MongoDB.
a {+framework+} database backend that uses PyMongo to connect to MongoDB.

Get Started
-----------
Expand All @@ -49,7 +49,7 @@ in the :ref:`django-connection-configuration` section.
Model Your Data
---------------

Learn how to create Django models that represent MongoDB collections
Learn how to create {+framework+} models that represent MongoDB collections
in the :ref:`django-model-data` section.

Interact with Data
Expand Down
49 changes: 25 additions & 24 deletions source/interact-data/crud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ collection.

You can also use the {+framework+} admin site to edit your models
and their corresponding collections on a web interface. For
more information, see the `Django Admin Site <https://docs.djangoproject.com/en/5.1/ref/contrib/admin/>`__
entry in the {+framework+} documentation.
more information, see :mod:`django.contrib.admin`
in the {+framework+} documentation.

Query API
~~~~~~~~~
Expand All @@ -41,9 +41,9 @@ to every model class.

.. tip::

To learn more about {+framework+}'s ``QuerySet`` API, see the
`QuerySet API reference <https://docs.djangoproject.com/en/5.1/ref/models/querysets/>`__
in the {+framework+} documentation.
To learn more about {+framework+}'s ``QuerySet`` API, see
:py:class:`~django.db.models.query.QuerySet` in the {+framework+}
documentation.

This guide shows how to use the following ``QuerySet`` methods:

Expand Down Expand Up @@ -115,10 +115,10 @@ code:

.. tip::

To learn more about the ``create()`` method, see `create()
<{+django-docs+}/ref/models/querysets/#create>`__ in the {+framework+}
To learn more about the ``create()`` method, see
:py:meth:`~django.db.models.query.QuerySet.create` in the {+framework+}
documentation.

.. _django-crud-read:

Read Documents
Expand Down Expand Up @@ -155,10 +155,10 @@ returns ``Movie`` objects that represent movies released on January 1, 2000:

.. tip::

To learn more about the ``filter()`` method, see `filter()
<{+django-docs+}/ref/models/querysets/#filter>`__ in the {+framework+}
documentation.

To learn more about the ``filter()`` method, see
:py:meth:`~django.db.models.query.QuerySet.filter`
in the {+framework+} documentation.
Return One Document Example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -192,9 +192,9 @@ retrieves a document in which the ``title`` value is ``"Boyhood"``:

.. tip::

To learn more about the ``get()`` method, see `get()
<{+django-docs+}/ref/models/querysets/#get>`__ in the {+framework+}
documentation.
To learn more about the ``get()`` method, see
:py:meth:`~django.db.models.query.QuerySet.get`
in the {+framework+} documentation.

.. _django-crud-modify:

Expand Down Expand Up @@ -231,18 +231,18 @@ a document that has a ``title`` value of ``"High Fidelity"`` and adds a

.. tip::

To learn more about the ``update()`` method, see `update()
<{+django-docs+}/ref/models/querysets/#update>`__ in the {+framework+}
documentation.
To learn more about the ``update()`` method, see
:py:meth:`~django.db.models.query.QuerySet.update`
in the {+framework+} documentation.

.. _django-crud-delete:

Delete Documents
----------------

To delete documents in a collection, call the ``filter()`` and ``delete()``
methods on your model's ``Manager`` class. Pass a query filter,
or criteria that specifies which documents to delete, as an argument to the
methods on your model's manager, Pass a query filter, or criteria
that specifies which documents to delete, as an argument to the
``filter()`` method.

Example
Expand All @@ -268,14 +268,15 @@ and deletes documents that have a ``runtime`` value of ``5``:

.. tip::

To learn more about the ``delete()`` method, see `delete()
<{+django-docs+}/ref/models/querysets/#delete>`__ in the {+framework+}
documentation.
To learn more about the ``delete()`` method, see
:py:meth:`~django.db.models.query.QuerySet.delete`
in the {+framework+} documentation.

Additional Information
----------------------

.. TODO: To learn more about performing read operations, see the Specify a Query guide.
To learn more about performing read operations, see the :ref:`django-specify-query`
guide.

To view more create, read, update, and delete examples, see the following
steps of the :ref:`django-get-started` tutorial:
Expand Down
Loading
Loading