Skip to content

Commit 5cdc0aa

Browse files
committed
fix some html issues
1 parent 4909f81 commit 5cdc0aa

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

chapter_post_and_database.asciidoc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ The notation is `{{ ... }}`, which displays the object as a string:
342342
<input name="item_text" id="id_new_item" placeholder="Enter a to-do item" />
343343
{% csrf_token %}
344344
</form>
345-
346345
<table id="id_list_table">
347346
<tr><td>{{ new_item_text }}</td></tr> <1>
348347
</table>
@@ -351,11 +350,7 @@ The notation is `{{ ... }}`, which displays the object as a string:
351350
====
352351

353352
<1> Here's our template variable.
354-
`new_item_text` will be the variable name for the user input we display in the template,
355-
to help distinguish it from `item_text`,
356-
which is the name of the form field which we use in the POST request.
357-
That will remind us that transforming the one into the other
358-
doesn't happen automatically; it's something we do ourselves in the view...
353+
`new_item_text` will be the variable name for the user input we display in the template.
359354

360355
Let's adjust our unit test so that it checks whether we are still using the template:
361356

@@ -685,7 +680,7 @@ other methods for your own purposes:
685680
rows = table.find_elements(By.TAG_NAME, "tr")
686681
self.assertIn(row_text, [row.text for row in rows])
687682
688-
def test_can_start_a_list_and_retrieve_it_later(self):
683+
def test_can_start_a_todo_list(self):
689684
[...]
690685
----
691686
====
@@ -716,8 +711,7 @@ and the first test. Let's use it in the FT:
716711
self.check_for_row_in_list_table("1: Buy peacock feathers")
717712
self.check_for_row_in_list_table("2: Use peacock feathers to make a fly")
718713
719-
# Edith wonders whether the site will remember her list. Then she sees
720-
[...]
714+
# Satisfied, she goes back to sleep
721715
----
722716
====
723717

@@ -1350,8 +1344,10 @@ def home_page(request):
13501344
{"new_item_text": request.POST.get("item_text", "")}, # <2>
13511345
)
13521346
----
1347+
====
13531348

13541349
<1> There's a quicker way to do these 3 lines with `.objects.create()`
1350+
13551351
<2> This line doesn't seem quite right now, in fact it won't work at all.
13561352
Let's make a note on our scratchpad to sort out passing list items to the template.
13571353
It's actually closely related to "Display multiple items",

tests/test_chapter_post_and_database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_listings_and_commands_and_output(self):
3030
print(self.listings[nutemplate_pos])
3131
assert '{"items": items}' in self.listings[nutemplate_pos].contents
3232

33-
migrate_pos = 84
33+
migrate_pos = 86
3434
assert "migrate" in self.listings[migrate_pos]
3535
assert self.listings[migrate_pos].type == "interactive manage.py"
3636

0 commit comments

Comments
 (0)