ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Django ORM - Updating and Deleting QuerySets / ForeignKey on_delete behaviour

Django

Django ORM

Python

Автор: BugBytes

Загружено: 2023-06-28

Просмотров: 10857

Описание: In this video, we look at how to update and delete models and querysets in Django.

For UPDATES, we'll look at updating an individual model (representing a DB row), and will see how to use the "update_fields" argument to the model save() method. We'll also look at the Django ModelState object's "adding" property. Finally, we'll see how to update an entire QuerySet, and set a value across that QuerySet.

For DELETES, we'll see how to delete individual models, as well as entire QuerySets of models. We'll also look at how the ForeignKey on_delete argument works during deletes, paying particular attention to the models.CASCADE and models.SET_NULL options.

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:48 Updating Django model instances
03:18 Passing updated fields to model save() method with update_fields argument
03:52 Checking whether model is added or updated in model save() method
06:59 Updating a QuerySet of records with queryset update() method
09:36 Filtering QuerySet with a startswith lookup in Django
15:22 Deleting model instances with model delete() function
16:17 Effect of CASCADE on_delete parameter on foreign key
20:20 Effect of SET_NULL on_delete parameter for foreign keys
21:34 Django QuerySet delete() method to remove multiple objects

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes

▶️ Full Playlist:
   • Django ORM Deep Dive  

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/
👾 Github: https://github.com/bugbytes-io/

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Django Model instance reference: https://docs.djangoproject.com/en/4.2...
Updating Multiple Records: https://docs.djangoproject.com/en/4.2...
Django Field Lookups: https://docs.djangoproject.com/en/4.2...

#python #django #webdevelopment #database #sql

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Django ORM - Updating and Deleting QuerySets / ForeignKey on_delete behaviour

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]