author | amit |
Fri, 15 Oct 2010 15:59:28 +0530 | |
changeset 2 | f5e18f8ed036 |
parent 0 | 54f784230511 |
permissions | -rw-r--r-- |
0
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
1 |
from django.contrib import admin |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
2 |
from sphinx_django.sphinxcomment.models import Comment, Element |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
3 |
|
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
4 |
class CommentAdmin(admin.ModelAdmin): |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
5 |
list_display = ['element', 'submitter_name', 'comment', 'date'] |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
6 |
search_fields = ['comment'] |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
7 |
date_hierarchy = 'date' |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
8 |
list_filter = ['date', 'submitter_name'] |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
9 |
search_fields = ['title', 'submitter_name', 'submitter_url'] |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
10 |
fieldsets = ( |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
11 |
(None, {'fields': ('submitter_name', 'element', 'comment')}), |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
12 |
('Other info', {'fields': ('submitter_url', 'ip')}), |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
13 |
) |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
14 |
# XXX: adding 'date' to the 'Other info' fieldset results in a |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
15 |
# ImproperlyConfigured error. :S |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
16 |
|
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
17 |
class ElementAdmin(admin.ModelAdmin): |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
18 |
search_fields = ['chapter_name'] |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
19 |
list_filter = ['chapter_name'] |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
20 |
|
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
21 |
admin.site.register(Comment, CommentAdmin) |
54f784230511
Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff
changeset
|
22 |
admin.site.register(Element, ElementAdmin) |