Skip to content

Instantly share code, notes, and snippets.

@ckinsey
Created August 24, 2012 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ckinsey/3452253 to your computer and use it in GitHub Desktop.
Save ckinsey/3452253 to your computer and use it in GitHub Desktop.
custom admin view
class FooAdmin(admin.ModelAdmin):
def get_urls(self):
urls = super(ContentProjectAdmin, self).get_urls()
extra_urls = patterns('',
url(r'^dashboard/$', self.admin_site.admin_view(self.dashboard), name="cms_dashboard"),
)
return extra_urls + urls
def dashboard(self, request):
tmpl = 'admin/cms/dashboard.html'
# Get all content state logs, filtered by organization
activity_log = ContentState.objects.all()
context = {
'activity_log': activity_log,
}
return render_to_response(tmpl, context, RequestContext(request))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment