File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
curriculum/section14/lectures/08_receive_validate_wtform Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ I think one of the best ways to do this is a `dataclass`. This is a Python objec
8484## Create a class for storing movie data
8585Let's start by creating a ` movie_library/models.py ` file. Inside it, we'll define a class that represents a movie.
8686
87+ ::: tip
88+ I made a diagram to help you visualize the change from dictionary to class for handling data and interacting with MongoDB. Hope it helps!
89+
90+ Link: [ https://snappify.io/view/b0880dd5-59c8-4d4b-902b-ca26b1681bb2 ] ( https://snappify.io/view/b0880dd5-59c8-4d4b-902b-ca26b1681bb2 )
91+ :::
92+
8793To "represent" a movie we'll define the properties of an object of said class, so that when we create an object, it will have all those properties.
8894
8995Using the ` dataclasses ` module, you'd do it like this:
You can’t perform that action at this time.
0 commit comments