312 | | One way to implement this very useful and needed functionality may be to have a builtin 'log' model class containing modified_by/time (should be populated withour user input), reason for modification (user comments) ..etc. We can inherit this in our models when necessary and voila! our classes would have an additional myproj_myapp_log table for auditing purposes. This table would contain all the fields of the class before modification with the extra fields from the log class. This log table should additionally be non-editable. Only inserts should be possible. No deletes/modifications. Mysql has an 'archive' table type to facilitate this. Other DBs should have their corresponding types. A History view for an object then could be built in the admin page which lists all modifications to an object from its creation till date - we could list only the attributes that have changed and highlight the changes alone. Modification date filters could be provided. This feature, I think will appeal to many. "Django - The framework with Inbuilt data auditing" - The IT Departments will love this. |
| 312 | a. One way to implement this very useful and needed functionality may be to have a inbuilt 'log/history' model class containing modified_by,modified_time (should be populated *without* user input), optional reason for modification (user comments) ..etc. We can inherit this in our models if necessary and voila! our classes would have an additional myproj_myapp_log table for auditing purposes. |
| 313 | |
| 314 | b. This log table would contain one row per object per modification with all the attributes of the object before modification + the extra fields from the log class. This log table should additionally be non-editable. Only inserts should be possible. No deletes/modifications. Mysql has an 'archive' table type to facilitate this. Other DBs should have their corresponding types. |
| 315 | |
| 316 | c. A History view for the object then could be built in the admin page which lists all modifications to an object from its creation till date - we could list only the attributes that have changed and highlight the changes alone. Modification date filters could be provided. |
| 317 | |
| 318 | This feature will appeal to many. "Django - The framework with Inbuilt data auditing" - The IT Departments will love this. |