My favorites | Sign in
Project Logo
                
Code license: MIT License
Labels: django, models, history, revisioning
Links:
Feeds:
People details
Project owners:
  thom.linton, jeffkistler

Revision Support for Django Models

Motivation

The 'fullhistory' branch has been lying dormant for a few months it seems (at least no commits to the django hosted branch) - so I've recently updated and implemented leftover functionality in a modified version of the branch.

Disclaimers

API

Method Name Return Value
get_version(obj,rev) Model/None
get_version_by_date(obj,date) QuerySet/list()
get_history(obj,offset=0) QuerySet/list()
set_version(obj,rev) Model/None
restore_version(content_type,obj_id,rev) Model/None

Future Work

  1. Modelhistory should probably provide some means (if end user-desired) of providing distinct tables for each revisioned object.
  2. With regard to (1), we have syncdb hooks and <model_log> could be autogenerated; however, (1) might be best served when coupled with a distinct subsystem that manages backend-specific logic - i.e., django/ multi-db allowing for a separate archival database, in which case this discussion would require a much broader consensus/design points.
  3. Consider implementing delta-only change log entries (full object serialized in first version, deltas only to follow - (space v. execution time (specifically,reverts))








Hosted by Google Code