Skip to content

Commit c1ec721

Browse files
committed
adds overarching helper requirements
1 parent 67212ac commit c1ec721

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

ada-project-docs/wave_01.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ Tasks should contain these attributes. **The tests require the following columns
3636
- We can assume that the value of each task's `completed_at` attribute will be `None`, until wave 3. (Read below for examples)
3737
- We can assume that the API will designate `is_complete` as `false`, until wave 3. (Read below for examples)
3838

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.
55+
3956
## CRUD for Tasks
4057

4158
### Tips

0 commit comments

Comments
 (0)