sphinx_django/sphinxcomment/admin.py
changeset 0 54f784230511
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sphinx_django/sphinxcomment/admin.py	Thu Sep 30 11:36:30 2010 +0530
@@ -0,0 +1,22 @@
+from django.contrib import admin
+from sphinx_django.sphinxcomment.models import Comment, Element
+
+class CommentAdmin(admin.ModelAdmin):
+    list_display = ['element', 'submitter_name', 'comment', 'date']
+    search_fields = ['comment']
+    date_hierarchy = 'date'
+    list_filter = ['date', 'submitter_name']
+    search_fields = ['title', 'submitter_name', 'submitter_url']
+    fieldsets = (
+        (None, {'fields': ('submitter_name', 'element', 'comment')}),
+               ('Other info', {'fields': ('submitter_url', 'ip')}),
+        )
+    # XXX: adding 'date' to the 'Other info' fieldset results in a
+    # ImproperlyConfigured error. :S
+
+class ElementAdmin(admin.ModelAdmin):
+    search_fields = ['chapter_name']
+    list_filter = ['chapter_name']
+
+admin.site.register(Comment, CommentAdmin)
+admin.site.register(Element, ElementAdmin)