summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2008-03-30 23:54:44 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2008-03-30 23:54:44 +0000
commitb2b6fb6b0704b8c788479c92f34bdababcb25054 (patch)
tree0c1b70abe80c3ed37ff0e686fbff135612be0fe1
parente7e5fecbe0908ef70196b0a77848ae492d4c01f0 (diff)
Beginnings of new admin view.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/admin/views/new.py52
1 files changed, 52 insertions, 0 deletions
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::
+ ``<app_label>/<model_name>/change_list.html``
+ ``<app_label>/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