To prevent updating every field of the model you can use the update_fields parameter. It expects a list of fields that you want to save. The UPDATE that is run against the database then only updates those fields that you have specified.
For example, in case we only want to update the price of a toy, we would run "toy.save(update_fields=["price"])".
2
28 reads
The idea is part of this collection:
Learn more about artificialintelligence with this collection
Find out the challenges it poses
Learn about the potential impact on society
Understanding the concept of Metaverse
Related collections
Similar ideas to Saving with update_fields
Underlying many of our difficulties with saving is that we only pay attention to our most immediate needs rather than prioritising a long-term saving strategy. We may also have an impulse to keep purchasing items to show off, such as a new phone (even if your exi...
If you want to measure success, better measure your progress with different parameters.
One parameter I use is to check if I'm able to do the small tasks that I have decided to do every day which are going to help me in the long-run.
This way we are focused on improving ourselves and ...
Read & Learn
20x Faster
without
deepstash
with
deepstash
with
deepstash
Personalized microlearning
—
100+ Learning Journeys
—
Access to 200,000+ ideas
—
Access to the mobile app
—
Unlimited idea saving
—
—
Unlimited history
—
—
Unlimited listening to ideas
—
—
Downloading & offline access
—
—
Supercharge your mind with one idea per day
Enter your email and spend 1 minute every day to learn something new.
I agree to receive email updates