Permalink
Browse files

[full-history]

* Changed the ChangeLog functions to correspond to new "managed" ones
* First attempt to print generic view of values



git-svn-id: http://code.djangoproject.com/svn/django/branches/full-history@3638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent f32226a commit e6b7a2d454731ed73ef7a572620cde2d3b67231a Uroš Trebec committed Aug 21, 2006
Showing with 12 additions and 10 deletions.
  1. +12 −10 django/contrib/history/views/main.py
@@ -2,7 +2,6 @@
#from django.db.models import get_models
#from django.utils.text import capfirst
from django.contrib.history.models import ChangeLog
-from django.contrib.history.models import get_version, list_history, version_by_date
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render_to_response
from datetime import datetime
@@ -15,8 +14,6 @@ def index(request):
{'changes_list': changes_list})
def list(request):
- #get_all_models()
-
changes_list = ChangeLog.objects.all()
return render_to_response('history/list.html',
{'changes_list': changes_list})
@@ -25,18 +22,23 @@ def list(request):
def detail(request, change_id):
change = get_object_or_404(ChangeLog, pk=change_id)
object = change.get_object()
- #print object
- bla = version_by_date(change, datetime(2006, 2, 8))
- for b in bla:
- print b.change_time
- #bla2 = get_version(change)
+ ch1 = ChangeLog.objects.version_by_date(object, datetime(2006, 8, 21))
+ print "Change1: ",ch1
+
+ ch2 = ChangeLog.objects.get_version(object)
+ print "Change2: ",ch2
+
+ ch3 = ChangeLog.objects.list_history(object, offset=1)
+ print "Change3: ",ch3
return render_to_response('history/detail.html', {'change': change,
- 'object': object})
+ 'object': object,
+ 'change_fields': change._meta.fields,
+ 'object_fields': object._meta.fields,})
def changes(request, parent_id):
- changes_list = list_history(parent_id, offset=3)
+ changes_list = ChangeLog.objects.list_history(parent, offset=3)
return render_to_response('history/list.html',
{'changes_list': changes_list})

0 comments on commit e6b7a2d

Please sign in to comment.