Get the code

TODO

This is a general list of tasks, details are managed in a Basecamp project. If you want access drop me an email at urosDOTtrebecATgmailDOTcom.

Task

Status

Getting the code to work generically (on every given model)

DONE

Getting the code to a working state

DONE

Getting the API to work as described below

DONE

Unit tests

(under way)

Author handling (default Anonymous)

Admin UI integration

(later)

Decoupled App (can be used outside the branch)

DONE

Discussion

The ability to keep previous states of a table accessible is well described in Richard T. Snodgrass's (​http://www.cs.arizona.edu/~rts/) "Developing Time-Oriented Database Applications in SQL" (​http://www.cs.arizona.edu/people/rts/tdbbook.pdf). Adding the ability to designate a particular model as a transaction-time state table, with suitable methods added to the model's API, and with all queries defaulting to using either the current time or the latest time.

Introduction

The problem

The changelog-type of history in its current implementation, would write log only when using Admin and log would include only information about the change but not the content that was changed. This is not very useful when you would like to revert a change or even see what was changed.

The main idea

I am trying to write a different implementation that will be independent of Admin and will store the content as well. This way developers will be able to save, compare and revert any changes made in any particular model.

Usage

How to enable history tracking?

Settings

You need to add the following to settings.py:

INSTALLED_APPS =('django.contrib.history',)

Models

Enabling history tracking for a particular model is just like adding Admin functionality - add an inner class as shown below: