Files @ 8f4c8a69d6f8
Branch filter:

Location: website/www/conservancy/apps/blog/admin.py

bkuhn
Rework blog's custom_index for new pagination.

The pagination support changed, and as was previously done a few commits
ago for news, I'm trying a similar solution for blogs.

In this case, I'm trying to use the existing custom_index() method we
have and adapt it to properly support pagination in the way we want.

I'm not completely sure this will work, but I think it's at least close.
from django.contrib import admin
from models import EntryTag, Entry

class EntryTagAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('label',)}

admin.site.register(EntryTag, EntryTagAdmin)

class EntryAdmin(admin.ModelAdmin):
    list_display = ('pub_date', 'headline', 'author')
    list_filter = ['pub_date']
    date_hierarchy = 'pub_date'
    search_fields = ['headline', 'summary', 'body']
    prepopulated_fields = {'slug': ("headline",)}
    filter_horizontal = ('tags',)


admin.site.register(Entry, EntryAdmin)