Skip to content

Commit a83eaa6

Browse files
authored
Merge pull request #245 from Xronophobe/review--chapter-14
some additions to chapter14
2 parents 2c6d971 + 24d6dda commit a83eaa6

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

chapter_14_simple_form.asciidoc

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
[[chapter_14_simple_form]]
22
== A Simple Form
33

4-
.🚧 Warning, Chapter update in progress
5-
*******************************************************************************
6-
This chapter is currently in the process of being rewritten for the 3e.
7-
8-
The code listings should all be valid,
9-
and work with Python3.12 + Django 4,
10-
but I haven't reviewed the chapter text in detail yet.
11-
12-
*******************************************************************************
13-
144

155
At the end of the last chapter,
166
we were left with the thought that there was too much duplication
@@ -615,9 +605,8 @@ with `id_text` and `text`, respectively:
615605
$ *grep -r id_new_item src/lists/*
616606
----
617607

618-
Good, there are no references to `id_new_item` left.
619-
// CSANAD: we could mention *.pyc files under __pycache__ would probably still
620-
// show up in the results.
608+
Good, there are no references to `id_new_item` left--except maybe in some
609+
`*.pyc` files, which are safe to ignore.
621610
What about `name`/ `item_text`?
622611

623612
[subs="specialcharacters,macros"]
@@ -678,6 +667,9 @@ element: .invalid-feedback; [...]
678667
[...]
679668
----
680669

670+
// TODO re-order the steps for this chapter: it would be better to start with
671+
// the `id_text` related errors first, and only then fix the validation.
672+
681673
Let's start with the latter.
682674
Checking _views.py_ and the `new_list` view we can see
683675
it's because if we detect a validation error,
@@ -1361,7 +1353,13 @@ Ran 4 tests in 14.367s
13611353
OK
13621354
----
13631355

1364-
Great! Our two views are now looking very much like "normal" Django views:
1356+
Great! Let's commit our changes:
1357+
[subs="specialcharacters,quotes"]
1358+
----
1359+
$ *git commit -am "implement custom save method for the form"*
1360+
----
1361+
1362+
Our two views are now looking very much like "normal" Django views:
13651363
they take information from a user's request,
13661364
combine it with some custom logic or information from the URL (`list_id`),
13671365
pass it to a form for validation and possible saving,

0 commit comments

Comments
 (0)