Skip to content

Commit bf6c7db

Browse files
committed
some additions to chapter14
add TODO to reorder steps, mention pycache, remove chapter update warning, add commit to the end of the chapter
1 parent 6f3c4cb commit bf6c7db

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

chapter_14_simple_form.asciidoc

Lines changed: 13 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,9 @@ 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. If you see these, Python generates them for faster execution
610+
and they will be regenerated when the code changes.
621611
What about `name`/ `item_text`?
622612

623613
[subs="specialcharacters,macros"]
@@ -678,6 +668,9 @@ element: .invalid-feedback; [...]
678668
[...]
679669
----
680670

671+
// TODO re-order the steps for this chapter: it would be better to start with
672+
// the `id_text` related errors first, and only then fix the validation.
673+
681674
Let's start with the latter.
682675
Checking _views.py_ and the `new_list` view we can see
683676
it's because if we detect a validation error,
@@ -1361,7 +1354,13 @@ Ran 4 tests in 14.367s
13611354
OK
13621355
----
13631356

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

0 commit comments

Comments
 (0)