Code

Changes between Version 37 and Version 38 of ModelInheritance


Ignore:
Timestamp:
06/10/06 20:00:03 (8 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModelInheritance

    v37 v38  
    3103101. auditing. I would like to have certain models have a created by/time and last-updated by/time on the record, and possibly a XXX_history table which shows the previous version on that entry when it gets changed. 
    311311 
    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. This feature, I think will appeal to many. "Django - The framework with Inbuilt data auditing" - The IT Departments will love this. 
     312One 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. 
    313313 
    3143142. tagging. I would like to 'mark' a model as being taggable, and let the mixin worry about the rest. This I could do now by overriding the many2many field type, but I think a mixing would be nicer