Mercurial > public > bravenewsurf
comparison bns_website/news/admin.py @ 22:6cb0d49187ae
I added a list_filter and search_fields to the model admin for the news app. That way you can sort by date and search the title and content.
author | Bob Mourlam <bob.mourlam@gmail.com> |
---|---|
date | Mon, 31 Oct 2011 21:45:03 -0500 |
parents | 5348d2235497 |
children | ced908af601a |
comparison
equal
deleted
inserted
replaced
21:687af3cb0525 | 22:6cb0d49187ae |
---|---|
3 | 3 |
4 """ | 4 """ |
5 from django.contrib import admin | 5 from django.contrib import admin |
6 from news.models import News | 6 from news.models import News |
7 | 7 |
8 admin.site.register(News) | 8 class NewsAdmin(admin.ModelAdmin): |
9 list_filter = ['date'] | |
10 search_fields = ['title', 'content'] | |
11 | |
12 admin.site.register(News, NewsAdmin) |