mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
Beginnings of new admin view.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e7e5fecbe0
commit
b2b6fb6b07
52
django/contrib/admin/views/new.py
Normal file
52
django/contrib/admin/views/new.py
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user