Mercurial > public > sg101
annotate bulletins/admin.py @ 661:15dbe0ccda95
Prevent exceptions when viewing downloads in the admin when the file
doesn't exist on the filesystem. This is usually seen in development
but can also happen in production if the file is missing.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 14 May 2013 21:02:47 -0500 |
parents | ee87ea74d46b |
children |
rev | line source |
---|---|
gremmie@1 | 1 ''' |
gremmie@1 | 2 This file contains the automatic admin site definitions for the Bulletins models. |
gremmie@1 | 3 ''' |
gremmie@1 | 4 |
gremmie@1 | 5 from django.contrib import admin |
bgneal@7 | 6 from django.conf import settings |
bgneal@7 | 7 |
gremmie@1 | 8 from bulletins.models import Bulletin |
gremmie@1 | 9 |
gremmie@1 | 10 class BulletinAdmin(admin.ModelAdmin): |
gremmie@1 | 11 list_display = ('title', 'start_date', 'end_date', 'is_enabled') |
gremmie@1 | 12 list_filter = ('start_date', 'end_date', 'is_enabled') |
gremmie@1 | 13 search_fields = ('title', 'text') |
gremmie@1 | 14 date_hierarchy = 'start_date' |
gremmie@1 | 15 |
gremmie@1 | 16 class Media: |
bgneal@7 | 17 js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] |
gremmie@1 | 18 |
gremmie@1 | 19 |
gremmie@1 | 20 admin.site.register(Bulletin, BulletinAdmin) |