From b2b6fb6b0704b8c788479c92f34bdababcb25054 Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Sun, 30 Mar 2008 23:54:44 +0000 Subject: [PATCH] Beginnings of new admin view. git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7390 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/views/new.py | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 django/contrib/admin/views/new.py diff --git a/django/contrib/admin/views/new.py b/django/contrib/admin/views/new.py new file mode 100644 index 0000000000..ee99fcf1c2 --- /dev/null +++ b/django/contrib/admin/views/new.py @@ -0,0 +1,52 @@ + + +class ChangeList(BaseView): + """ + The admin change list view. + + Templates:: + ``//change_list.html`` + ``/change_list.html`` + ``admin/change_list.html`` + Context:: + object_list + + paginator + + page_obj + """ + def __init__(self, queryset=None, fields=None, filter_fields=None, + search_fields=None, date_hierarchy=None): + self.fields = fields + self.filter_fields = filter_fields + self.search_fields = search_fields + self.date_hierarchy = date_hierarchy + super(ChangeList, self).__init__(queryset) + + def __call__(self, request): + pass + + def get_template(self, request, obj=None): + opts = self.model._meta + template_path = [ + 'admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()), + 'admin/%s/change_list.html' % app_label, + 'admin/change_list.html' + ] + return loader.find_template(template_path) + +class EditView(BaseDetailView): + def get_template(self, request, obj=None): + opts = self.model._meta + template_path = [ + 'admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()), + 'admin/%s/change_list.html' % app_label, + 'admin/change_list.html' + ] + return loader.find_template(template_path) + +class DeleteView(BaseDetailView): + pass + +class HistoryView(BaseDetailView): + pass \ No newline at end of file