Update Query
Video Player is loading.
Loaded: 0%
Current Time 0:00
/
Duration -:-
- , opens subtitles settings dialogsubtitles settings
- subtitles off
- , selectedEnglish Captions
1x
- 2x
- 1.5x
- , selected1x
- 0.5x
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
Let's talk about how to UPDATE elements, allowing you to edit specific parts of a recipe or update the entire recipe, completing the CRUD operations in Flask.
Remember how we easily accessed different fields of our model by using the following method:
python912Recipe.query.get(1).author
Just assign a new value to the attribute:
python9123Recipe.query.get(1).author = "Monica"db.session.commit()
This command is just to check the functionality of the previous two:
python912Recipe.query.filter_by(author="Monica").all()
You can edit other fields as well.
Now we know how to READ, CREATE, UPDATE, and DELETE.
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 3. Hoofdstuk 5
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.