gremmie@1: """ gremmie@1: This file contains the automatic admin site definitions for the gcalendar application. gremmie@1: """ gremmie@1: from django.contrib import admin gremmie@1: from django.http import HttpResponse gremmie@1: from django.conf.urls.defaults import * gremmie@1: gremmie@1: from gcalendar.models import Event gremmie@1: from gcalendar.admin_views import google_sync gremmie@1: gremmie@1: gremmie@1: class EventAdmin(admin.ModelAdmin): gremmie@1: list_display = ('what', 'user', 'start_date', 'where', 'date_submitted', gremmie@1: 'status', 'needs_approval') gremmie@1: list_filter = ('start_date', 'status') gremmie@1: search_fields = ('what', 'where', 'description') gremmie@1: raw_id_fields = ('user', ) gremmie@1: exclude = ('html', 'google_id') gremmie@1: save_on_top = True gremmie@1: gremmie@1: def get_urls(self): gremmie@1: urls = super(EventAdmin, self).get_urls() gremmie@1: my_urls = patterns('', gremmie@1: url(r'^google_sync/$', gremmie@1: self.admin_site.admin_view(google_sync), gremmie@1: name="gcalendar-google_sync") gremmie@1: ) gremmie@1: return my_urls + urls gremmie@1: gremmie@1: gremmie@1: admin.site.register(Event, EventAdmin) gremmie@1: gremmie@1: # vim: ts=4 sw=4