| marp | true |
|---|---|
| theme | gaia |
| paginate | true |
| $size | 14580 |
| backgroundColor |
Moderator: Javier Buzzi
Model.objects.create(property1=value1, property2=value2)m = Model(property1=value1, property2=value2)
m.save()- Whats happening under the hood?
- Whats happens to the related objects?
- What happens if the object is already in the database?
m.refresh_from_db()- Whats happening under the hood?
- Whats happens to the related objects?
- What happens if the object is not in the database?
m.delete()Model.objects.filter(id=m.id).delete()- Whats happening under the hood?
- Whats happens to the related objects?
- What happens if the object is not in the database?
m._state- Whats happening under the hood?
- Why is it important?
- What happens if it's
m.pkisNoneandm._state.addingisFalse?
Thank you!