diff gpp/oembed/admin.py @ 285:8fd4984d5c3b

This is a first rough commit for #95, adding the ability to embed YouTube videos in forum posts. Some more polish and testing needs to happen at this point. I wanted to get all these changes off my hard drive and into the repository.
author Brian Neal <bgneal@gmail.com>
date Thu, 14 Oct 2010 02:39:35 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gpp/oembed/admin.py	Thu Oct 14 02:39:35 2010 +0000
@@ -0,0 +1,24 @@
+"""
+Admin site definitions for the oembed application.
+"""
+from django.contrib import admin
+
+from oembed.models import Provider
+from oembed.models import Oembed
+
+
+class ProviderAdmin(admin.ModelAdmin):
+    list_display = ('name', 'api_endpoint', 'format')
+    list_filter = ('format', )
+    search_fields = ('name', )
+
+
+class OembedAdmin(admin.ModelAdmin):
+    date_hierarchy = 'date_added'
+    list_display = ('__unicode__', 'type', 'url', 'date_added')
+    list_filter = ('type', )
+    search_fields = ('title', )
+
+
+admin.site.register(Provider, ProviderAdmin)
+admin.site.register(Oembed, OembedAdmin)