Skip to content

Commit 781c252

Browse files
committed
Spelling and grammar fixes
1 parent 31a1267 commit 781c252

28 files changed

+74
-74
lines changed

docs/test_doc_abstraction_levels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def index(request):
5656

5757
# language=rst
5858
"""
59-
The iommi middleware will handle if you return an iommi type and render it properly.
59+
The iommi middleware will detect when you return an iommi type and render it properly.
6060
6161
At this point you might think "Hold on! Where is the template?". There isn't one. We don't need a template. iommi works at a higher level of abstraction. Don't worry, you can drop down to templates if you need to though. This will be covered later.
6262

docs/test_doc_access_control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
Access control
55
~~~~~~~~~~~~~~
66
7-
The iommi admin only allows access to users with the `is_staff` flag. Other than that iommi doesn't enforce any access control on its own. If you need any you have to implement it yourself for your specific use case. That being said here are a few ideas:
7+
The iommi admin only allows access to users with the `is_staff` flag. Other than that iommi doesn't enforce any access control on its own. If you need any you have to implement it yourself for your specific use case. That being said, here are a few ideas:
88
99
- Middleware that checks URL of requests coming in, limiting certain paths (or all paths) to logged in users, users belonging to certain groups, etc. This is the easiest to get right as it's in one place and is easy to reason about. It can't handle many common cases, but it can be a good base to stand on.
1010
- Path decoders in iommi can be used for access control if the object being decoded has access semantics. For example `/company/1/` could validate that the user is a member of the company with pk 1.
11-
- You can generalize path decoder logic to call an `has_access` method on the model you decode.
11+
- You can generalize path decoder logic to call a `has_access` method on the model you decode.
1212
- The `LoginRequiredMiddleware <https://docs.djangoproject.com/en/5.1/ref/middleware/#django.contrib.auth.middleware.LoginRequiredMiddleware>`_ can be used to default URLs to denied, where you have to mark allowed URLs with the `@login_not_required` decorator.
1313
1414
"""

docs/test_doc_admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class MyAdmin(Admin):
101101

102102
# language=rst
103103
"""
104-
Now you have the iommi admin gui for your app!
104+
Now you have the iommi admin GUI for your app!
105105
"""
106106

107107

@@ -130,9 +130,9 @@ class Meta:
130130

131131
# language=rst
132132
"""
133-
This is especially useful for adding config to a third party app that doesn't have built in iommi admin configuration.
133+
This is especially useful for adding config to a third party app that doesn't have built-in iommi admin configuration.
134134
135-
You can also add the config in the app, by creating a `iommi_admin.py` file in your app, and putting the configuration there:
135+
You can also add the config in the app, by creating an `iommi_admin.py` file in your app, and putting the configuration there:
136136
137137
138138
"""

docs/test_doc_after.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
`after`
66
-------
77
8-
Ordering of fields and columns is based on the declared order, the order in the model (when using :ref:`auto`), and the `after` configuration. The last takes precedent over the others.
8+
Ordering of fields and columns is based on the declared order, the order in the model (when using :ref:`auto`), and the `after` configuration. The last takes precedence over the others.
99
1010
To order fields, set `after` to:
1111

docs/test_doc_architecture.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_refine_done():
5959
you call `bind()` on an object that hasn't had `refine_done()` called yet),
6060
or you can do it explicitly yourself.
6161
62-
The refine done step does a lot of of the work that is needed for the final
62+
The refine done step does a lot of the work that is needed for the final
6363
traversal step, so if possible you want to make sure this is done before.
6464
If this step is done on an object that is then kept around, all this work
6565
doesn't need to be redone. Examples of work that is done in this step include
@@ -128,7 +128,7 @@ def test_bind():
128128
1. Copy of the part. (We set a member `_declared` to point to the original definition if you need to refer to it for debugging purposes.)
129129
2. Set the `parent` and set `_is_bound` to `True`
130130
3. Style application
131-
4. Call the parts `on_bind` method
131+
4. Call the part's `on_bind` method
132132
133133
The parts are responsible for calling `bind(parent=self)` on all their children in `on_bind`.
134134
@@ -203,7 +203,7 @@ def another_function(y=None, z=None):
203203
# language=rst
204204
"""
205205
This is really useful for the `Table` class as it means we can expose the full
206-
feature set of the underling `Query` and `Form` classes by just
206+
feature set of the underlying `Query` and `Form` classes by just
207207
dispatching keyword arguments downstream. It also enables us to bundle
208208
commonly used features in what we call "shortcuts", which are pre-packaged sets of defaults.
209209
"""

docs/test_doc_common_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Many configuration options are common across iommi, forming part of the cohesive structure which makes it easy to transfer your skills from one part of iommi to another. The most important is `include` which is the command you use to include or exclude a part from an iommi component, for example removing a field from a form or including a field that by default would be hidden (like the primary key for forms and tables).
77
8-
`attr` and `attrs` are important to understand the difference between.
8+
`attr` and `attrs` are easy to confuse, so it's important to understand the difference between them.
99
1010
`auto` is used to generate forms, tables, etc from models.
1111

docs/test_doc_cookbook_forms.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ def test_how_do_i_specify_which_fields_to_show():
6666
"""
6767
This will show the field `name` only if the GET parameter `some_parameter` is set to `hello!`.
6868
69-
To be more precise, `include` turns off the entire field. See :ref:`field-non-editable` and :ref:`field-hidden`
69+
To be more precise, `include` turns off the entire field. See :ref:`field-non-editable` and :ref:`field-hidden`
7070
"""
7171

7272
# language=rst
7373
"""
74-
Use `auto__include`, to specify the complete list of fields you want:
74+
Use `auto__include` to specify the complete list of fields you want:
7575
"""
7676

7777
form = Form.create(
@@ -433,7 +433,7 @@ def test_how_do_i_set_if_a_field_is_required():
433433

434434
# language=rst
435435
"""
436-
...and this CSS added to your sites custom style sheet:
436+
...and this CSS added to your site's custom style sheet:
437437
438438
.. code-block:: css
439439
@@ -502,8 +502,8 @@ def test_how_do_i_specify_which_model_fields_the_search_of_a_choice_queryset_use
502502
503503
.. _field-search-fields:
504504
505-
How do I specify which model fields the search of a choice_queryset use?
506-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
505+
How do I specify which model fields the search of a choice_queryset uses?
506+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
507507
.. uses Field.search_fields
508508
509509
`Form.choice_queryset` uses the registered search fields for filtering and ordering.
@@ -639,7 +639,7 @@ def test_how_do_i_change_how_fields_are_rendered_everywhere_in_my_project():
639639
When you do that you will get English language relative date parsing
640640
(e.g. "yesterday", "3 days ago") for free, because iommi used to use a
641641
text based input control and the parser is applied no matter what
642-
(its just that when using the default date picker control it will
642+
(it's just that when using the default date picker control it will
643643
always only see ISO-8601 dates).
644644
"""
645645

@@ -859,7 +859,7 @@ def test_non_rendered(black_sabbath):
859859

860860
# language=rst
861861
"""
862-
Accessing this create form with `?year=1999` in the title will create this object on submit:
862+
Accessing this create form with `?year=1999` in the URL will create this object on submit:
863863
"""
864864

865865
# @test
@@ -895,7 +895,7 @@ def test_grouped_fields():
895895
896896
.. uses Field.group
897897
898-
Use the `group` field:
898+
Use the `group` parameter:
899899
"""
900900

901901
form = Form(
@@ -1113,7 +1113,7 @@ def test_how_do_i_make_a_form_to_create_or_edit(black_sabbath, album):
11131113
.. uses Form.create_or_edit
11141114
11151115
If you don't know until runtime if you want `Form.create` or `Form.edit`,
1116-
you can use the `Form.create_or_edit` shortcut. Ff the `instance` is `None`
1116+
you can use the `Form.create_or_edit` shortcut. If the `instance` is `None`
11171117
it will become a create form, otherwise an edit form:
11181118
"""
11191119

@@ -1238,7 +1238,7 @@ def post_validation(**_):
12381238

12391239
# language=rst
12401240
"""
1241-
You can get the errors on a given `Field` like this (not that you get a `set`!):
1241+
You can get the errors on a given `Field` like this (note that you get a `set`!):
12421242
"""
12431243

12441244
# @test

docs/test_doc_cookbook_main_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def test_nesting():
175175
.. uses M.items
176176
.. uses M.open
177177
178-
You can create a menu hierarchy with the `items` argument, which produces expandable sections. iommi will open the menu items that matches the current URL by default. You can also force a submenu to be open with the `open` argument:
178+
You can create a menu hierarchy with the `items` argument, which produces expandable sections. iommi will open the menu items that match the current URL by default. You can also force a submenu to be open with the `open` argument:
179179
"""
180180

181181
menu = MainMenu(

docs/test_doc_cookbook_parts_pages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ def test_how_do_i_set_the_title_of_my_page():
118118
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119119
.. uses Page.title
120120
121-
As in the text shown in the browser status bar?
121+
The title of a the page is text shown in the browser tab.
122122
123123
"""
124124
Page(title='The title in the browser')
125125

126126
# language=rst
127127
"""
128-
Note that this is different from
128+
Note that this is different from:
129129
"""
130130

131131
class MyPage(Page):

docs/test_doc_cookbook_queries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def test_how_do_I_set_the_name_for_a_filter(big_discography):
103103
104104
.. uses Filter.query_name
105105
106-
By default the name of filters are derived from the name you specify or from the model field name
107-
For deeply nested names double underscores are replaced with single underscores, and those names
106+
By default the names of filters are derived from the name you specify or from the model field name.
107+
For deeply nested names, double underscores are replaced with single underscores, and those names
108108
can become a bit unwieldy. You can then override this with `query_name`:
109109
"""
110110

0 commit comments

Comments
 (0)