Skip to content

Commit 67212ac

Browse files
committed
removes obsoleted optional content and adds recommendation for sort and filter
1 parent c6a4a8e commit 67212ac

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

ada-project-docs/optional-enhancements.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,16 @@ How would you write tests for it? How would you implement it?
2828

2929
Your decisions should not break the other tests.
3030

31-
### Model Instance Methods
32-
33-
We can define instance methods in our model classes.
34-
35-
Consider places in your code that deal with one model at a time. Is there any repeated logic or behavior?
36-
37-
Here are some ideas to start:
38-
39-
- Create an instance method in `Task` named `to_dict()`
40-
- Converts a `Task` instance into JSON
41-
- Returns a Python dictionary in the shape of the JSON our API returns in the `GET` `/tasks` route
42-
- Create a class method in `Task` named `from_json()`
43-
- Converts JSON into a new instance of `Task`
44-
- Takes in a dictionary in the shape of the JSON our API receives in the create and update routes
45-
- Returns an instance of `Task`
46-
4731
### Use List Comprehensions
4832

4933
Use list comprehensions in your route functions where applicable.
5034

51-
### Route Helper Methods
52-
53-
If you have not already refactored your route files to use helper methods, do so now!
54-
55-
Consider code with complex or repetitive logic, and refactor it into helper methods. Watch your route files become cleaner and more readable!
56-
5735
### More Query Params
5836

5937
Create the tests and implementation so that the user may
6038

6139
- filter tasks by title
6240
- sort tasks by id
6341
- sort goals by title
42+
43+
Remember that Wave 2 already has a sorting feature for tasks by title, so we might practice creating another route helper method that can be used for sorting across multiple model types. Such a method could even be extended to perform the filtering as well!

0 commit comments

Comments
 (0)