You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ada-project-docs/wave_01.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,23 @@ Tasks should contain these attributes. **The tests require the following columns
36
36
- We can assume that the value of each task's `completed_at` attribute will be `None`, until wave 3. (Read below for examples)
37
37
- We can assume that the API will designate `is_complete` as `false`, until wave 3. (Read below for examples)
38
38
39
+
## Model Helper Methods
40
+
41
+
We have seen that we can define instance methods in our model classes. We should practice those skills here by including model helper methods that can:
42
+
43
+
- Return a Python dictionary in the shape of the JSON our API expects to return for a model instance.
44
+
- Create a new model instance from a dictionary, typically retrieved from the JSON sent as a request body.
45
+
46
+
## Route Helper Methods
47
+
48
+
Beyond model helper methods, we should also practice creating route helper methods. Especially in this wave, we should consider creating a route helper method that can:
49
+
50
+
- Retrieve a model instance by its ID.
51
+
52
+
We might also consider creating a route helper method that can:
53
+
54
+
- Handle the creation of new instances of a model from a dictionary, returning the expected responses.
0 commit comments