django-admin2/example/blog/admin.py
Kevin Diale 29eaa661d5 Drilling down works on a functional level. Gotta set up interface and
tests.

On a related note, TAKE THAT DJANGO FILTERS.
2013-07-30 16:28:24 -04:00

20 lines
495 B
Python

# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, unicode_literals
from django.contrib import admin
from .models import Post, Comment
class CommentInline(admin.TabularInline):
model = Comment
class PostAdmin(admin.ModelAdmin):
inlines = [CommentInline, ]
search_fields = ('title', 'body', "published_date")
list_filter = ['published', 'title']
date_hierarchy = "published_date"
admin.site.register(Post, PostAdmin)
admin.site.register(Comment)