Contenido del Curso
Django ORM Ninja: Técnicas Avanzadas para Desarrolladores
Django ORM Ninja: Técnicas Avanzadas para Desarrolladores
Updating
To update specific information of an object in our table, we first need to retrieve that object, commonly using the get
method:
Now, let's say we want to update the pen name of this author. We first access the current attributes:
Let's imagine that we want to update pen_name of our 3-d author.
To update the pen name to 'James Clear', we assign the new value and save the object:
And that's essentially it for updating an object.
¡Gracias por tus comentarios!