Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Updating | Queries
Django ORM Ninja: Advanced Techniques for Developers
course content

Зміст курсу

Django ORM Ninja: Advanced Techniques for Developers

Django ORM Ninja: Advanced Techniques for Developers

1. Introduction to Django ORM
2. Models, datatypes, and fields
3. Queries
4. Relations
5. Complex Queries
6. Advanced

book
Updating

To update specific information of an object in our table, we first need to retrieve that object, commonly using the get method:

python

Now, let's say we want to update the pen name of this author. We first access the current attributes:

python

Let's imagine that we want to update the pen_name of our 3-d author.

To update the pen name to "James Clear", we assign the new value and save the object:

python

And that's essentially it for updating an object.

1. Before updating an object in Django, what is the recommended first step?

2. How do you update the 'pen_name' attribute of an Author object in Django?

3. What must you do after changing an attribute of a Django object to persist the update?

question mark

Before updating an object in Django, what is the recommended first step?

Виберіть правильну відповідь

question mark

How do you update the 'pen_name' attribute of an Author object in Django?

Виберіть правильну відповідь

question mark

What must you do after changing an attribute of a Django object to persist the update?

Виберіть правильну відповідь

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 5
We're sorry to hear that something went wrong. What happened?
some-alt