annotate gpp/gcalendar/admin.py @ 143:1ed461fd2030

Podcast enhancements for #39. Provide channel level keyword support. Provide an alternate download URL so we can support both m4a and mp3 formats.
author Brian Neal <bgneal@gmail.com>
date Sun, 06 Dec 2009 21:28:31 +0000
parents e04d91babfcf
children bc657962941e
rev   line source
gremmie@1 1 """
gremmie@1 2 This file contains the automatic admin site definitions for the gcalendar application.
gremmie@1 3 """
gremmie@1 4 from django.contrib import admin
gremmie@1 5 from django.http import HttpResponse
gremmie@1 6 from django.conf.urls.defaults import *
gremmie@1 7
gremmie@1 8 from gcalendar.models import Event
gremmie@1 9 from gcalendar.admin_views import google_sync
gremmie@1 10
gremmie@1 11
gremmie@1 12 class EventAdmin(admin.ModelAdmin):
gremmie@1 13 list_display = ('what', 'user', 'start_date', 'where', 'date_submitted',
bgneal@139 14 'status', 'is_approved')
gremmie@1 15 list_filter = ('start_date', 'status')
gremmie@1 16 search_fields = ('what', 'where', 'description')
gremmie@1 17 raw_id_fields = ('user', )
gremmie@1 18 exclude = ('html', 'google_id')
gremmie@1 19 save_on_top = True
gremmie@1 20
gremmie@1 21 def get_urls(self):
gremmie@1 22 urls = super(EventAdmin, self).get_urls()
gremmie@1 23 my_urls = patterns('',
gremmie@1 24 url(r'^google_sync/$',
gremmie@1 25 self.admin_site.admin_view(google_sync),
gremmie@1 26 name="gcalendar-google_sync")
gremmie@1 27 )
gremmie@1 28 return my_urls + urls
gremmie@1 29
gremmie@1 30
gremmie@1 31 admin.site.register(Event, EventAdmin)
gremmie@1 32
gremmie@1 33 # vim: ts=4 sw=4