In this video, learn how to build an override for the Django REST framework that turns deletion into a flag in the database. Deleted objects are filtered but not removed from the database, useful when records are audited and checked for records retention compliance.
- [Instructor] When deleting data in a Django app … we need to be aware of compliance requirements … and whether the data can be truly deleted. … We create a new data model, … which will store a copy of the deleted data. … So we need to store the model type that was deleted. … And then we have to store the ID … of the model that was deleted. … And then we store the actual data. … And now whenever we delete a booking model instance, … we're going to be archiving it, … and storing it in the DeletedData model. … Now we do this by using DJango serializers … and we're going to store a JSON copy … of this instance that was deleted, … and then we're going to store it in the DeletedData objects. … So the model type is booking. … The model ID is the instance ID, … and the data is the serialized version of that data. … Later on, if we ever need to recover this data, … and restore it, … we can do that just given the ID. … We can find it in deleted data. … Say that the model tape is booking model ID is the given ID. …
Skill Level Advanced
Building a Paid Membership Site with Djangowith Nick Walter1h 15m Intermediate
OWASP Top 10: #7 XSS and #8 Insecure Deserializationwith Caroline Wong26m 31s Intermediate
Building RESTful Web APIs with Djangowith Rudolf Olah1h 9m Intermediate
1. Permissions, Access Controls, Activity Logs
2. Throttling a Flood of Requests
3. Protecting Data and Data Privacy
4. 2FA: Two-Factor Authentication
5. CSRF: Cross-Site Request Forgery Protection
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.