Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from roverdotcom/no-admin-pickup
Browse files Browse the repository at this point in the history
Do not wrap admin by default
  • Loading branch information
delinhabit committed Jul 21, 2015
2 parents 6828299 + 98f29e4 commit 926161f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions nexus/nexus_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def render_change_form(self, request, context, add=False, change=False, form_url
def changelist_view(self, request, extra_context=None):
opts = self.model._meta
app_label = opts.app_label

self.change_list_template = (
'nexus/admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
'nexus/admin/%s/change_list.html' % app_label,
Expand All @@ -39,14 +39,14 @@ def changelist_view(self, request, extra_context=None):
extra_context = self.admin_site.get_context(request)
else:
extra_context.update(self.admin_site.get_context(request))

del extra_context['title']
return super(NexusModelAdmin, self).changelist_view(request, extra_context)

def delete_view(self, request, object_id, extra_context=None):
opts = self.model._meta
app_label = opts.app_label

self.delete_confirmation_template = (
'nexus/admin/%s/%s/delete_confirmation.html' % (app_label, opts.object_name.lower()),
'nexus/admin/%s/delete_confirmation.html' % app_label,
Expand All @@ -57,14 +57,14 @@ def delete_view(self, request, object_id, extra_context=None):
extra_context = self.admin_site.get_context(request)
else:
extra_context.update(self.admin_site.get_context(request))

del extra_context['title']
return super(NexusModelAdmin, self).delete_view(request, object_id, extra_context)

def history_view(self, request, object_id, extra_context=None):
opts = self.model._meta
app_label = opts.app_label

self.object_history_template = (
'nexus/admin/%s/%s/object_history.html' % (app_label, opts.object_name.lower()),
'nexus/admin/%s/object_history.html' % app_label,
Expand All @@ -75,7 +75,7 @@ def history_view(self, request, object_id, extra_context=None):
extra_context = self.admin_site.get_context(request)
else:
extra_context.update(self.admin_site.get_context(request))

del extra_context['title']
return super(NexusModelAdmin, self).history_view(request, object_id, extra_context)
return NexusModelAdmin
Expand All @@ -86,7 +86,7 @@ class NexusAdminSite(admin_site.__class__):
app_index_template = None
password_change_template = 'nexus/admin/password_change_form.html'
password_change_done_template = 'nexus/admin/password_change_done.html'

def has_permission(self, request):
return self.module.site.has_permission(request)

Expand Down Expand Up @@ -163,5 +163,6 @@ def render_on_dashboard(self, request):
}, request)
return AdminModule

if 'django.contrib.admin' in settings.INSTALLED_APPS:
nexus.site.register(make_admin_module(admin.site, admin.site.name, admin.site.app_name), admin.site.app_name)

if 'django.contrib.admin' in settings.INSTALLED_APPS and getattr(settings, 'NEXUS_WRAP_ADMIN', False):
nexus.site.register(make_admin_module(admin.site, admin.site.name, admin.site.app_name), admin.site.app_name)

0 comments on commit 926161f

Please sign in to comment.