Changeset 3423
- Timestamp:
- 07/22/06 05:19:05 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/full-history/django/contrib/history/views/main.py
r3351 r3423 1 1 from django.db import models 2 from django.db.models import get_models3 from django.utils.text import capfirst4 from django.contrib.history.models import ChangeLog, get_version, list_history, version_by_date 2 #from django.db.models import get_models 3 #from django.utils.text import capfirst 4 from django.contrib.history.models import ChangeLog, get_version, list_history, version_by_date, get_all_models 5 5 from django.http import HttpResponse 6 6 from django.shortcuts import get_object_or_404, render_to_response … … 15 15 16 16 def list(request): 17 app_list = [] 18 19 for app in models.get_apps(): 20 app_models = get_models(app) 21 app_label = app_models[0]._meta.app_label 22 23 model_list = [] 24 25 for m in app_models: 26 model_list.append({ 27 'name': capfirst(m._meta.verbose_name_plural), 28 }) 29 30 if model_list: 31 model_list.sort() 32 app_list.append({ 33 'name': app_label.title(), 34 'models': model_list, 35 }) 36 37 for app in app_list: 38 print app['name'] 39 print app['models'] 17 get_all_models() 40 18 41 19 changes_list = ChangeLog.objects.all() … … 58 36 59 37 def changes(request, parent_id): 60 changes_list = list_history(parent_id, 2)38 changes_list = list_history(parent_id, offset=3) 61 39 return render_to_response('history/list.html', 62 40 {'changes_list': changes_list})
