Changes between Version 3 and Version 4 of FullHistory
- Timestamp:
- Jul 16, 2006, 3:58:02 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FullHistory
v3 v4 10 10 You can grab the current code from the "full-history" branch: 11 11 {{{ 12 svn co 12 svn co http://code.djangoproject.com/svn/django/branches/full-history/ 13 13 }}} 14 14 … … 35 35 #!python 36 36 class Post(models.Model): 37 38 39 40 37 author = models.CharField(maxlength=100) 38 title = models.CharField(maxlength=100) 39 content = models.TextField() 40 date = models.dateField() 41 41 42 43 42 class History: 43 pass 44 44 }}} 45 45 46 When this is done every "Post" object will be saved to a "appname_history" table when created, changed or deleted. 46 When this is done every "Post" object will be saved to a "appname_history" table when created, changed or deleted. 47 47 48 48 === API === … … 78 78 poll1 = poll1.revisions.revert_to(id=222) 79 79 }}} 80 81 82 === Discussion === 83 84 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.