| 93 | | class Admin: |
|---|
| 94 | | fields = ( |
|---|
| 95 | | (None, {'fields': ('content_type', 'object_id', 'site')}), |
|---|
| 96 | | ('Content', {'fields': ('user', 'headline', 'comment')}), |
|---|
| 97 | | ('Ratings', {'fields': ('rating1', 'rating2', 'rating3', 'rating4', 'rating5', 'rating6', 'rating7', 'rating8', 'valid_rating')}), |
|---|
| 98 | | ('Meta', {'fields': ('is_public', 'is_removed', 'ip_address')}), |
|---|
| 99 | | ) |
|---|
| 100 | | list_display = ('user', 'submit_date', 'content_type', 'get_content_object') |
|---|
| 101 | | list_filter = ('submit_date',) |
|---|
| 102 | | date_hierarchy = 'submit_date' |
|---|
| 103 | | search_fields = ('comment', 'user__username') |
|---|
| 104 | | raw_id_fields = ('user',) |
|---|
| 180 | | class Admin: |
|---|
| 181 | | fields = ( |
|---|
| 182 | | (None, {'fields': ('content_type', 'object_id', 'site')}), |
|---|
| 183 | | ('Content', {'fields': ('person_name', 'comment')}), |
|---|
| 184 | | ('Meta', {'fields': ('submit_date', 'is_public', 'ip_address', 'approved')}), |
|---|
| 185 | | ) |
|---|
| 186 | | list_display = ('person_name', 'submit_date', 'content_type', 'get_content_object') |
|---|
| 187 | | list_filter = ('submit_date',) |
|---|
| 188 | | date_hierarchy = 'submit_date' |
|---|
| 189 | | search_fields = ('comment', 'person_name') |
|---|
| | 270 | |
|---|
| | 271 | # Register the admin options for these models. |
|---|
| | 272 | # TODO: Maybe this should live in a separate module admin.py, but how would we |
|---|
| | 273 | # ensure that module was loaded? |
|---|
| | 274 | |
|---|
| | 275 | from django.contrib import admin |
|---|
| | 276 | |
|---|
| | 277 | class CommentAdmin(admin.ModelAdmin): |
|---|
| | 278 | fields = ( |
|---|
| | 279 | (None, {'fields': ('content_type', 'object_id', 'site')}), |
|---|
| | 280 | ('Content', {'fields': ('user', 'headline', 'comment')}), |
|---|
| | 281 | ('Ratings', {'fields': ('rating1', 'rating2', 'rating3', 'rating4', 'rating5', 'rating6', 'rating7', 'rating8', 'valid_rating')}), |
|---|
| | 282 | ('Meta', {'fields': ('is_public', 'is_removed', 'ip_address')}), |
|---|
| | 283 | ) |
|---|
| | 284 | list_display = ('user', 'submit_date', 'content_type', 'get_content_object') |
|---|
| | 285 | list_filter = ('submit_date',) |
|---|
| | 286 | date_hierarchy = 'submit_date' |
|---|
| | 287 | search_fields = ('comment', 'user__username') |
|---|
| | 288 | raw_id_fields = ('user',) |
|---|
| | 289 | |
|---|
| | 290 | class FreeCommentAdmin(admin.ModelAdmin): |
|---|
| | 291 | fields = ( |
|---|
| | 292 | (None, {'fields': ('content_type', 'object_id', 'site')}), |
|---|
| | 293 | ('Content', {'fields': ('person_name', 'comment')}), |
|---|
| | 294 | ('Meta', {'fields': ('submit_date', 'is_public', 'ip_address', 'approved')}), |
|---|
| | 295 | ) |
|---|
| | 296 | list_display = ('person_name', 'submit_date', 'content_type', 'get_content_object') |
|---|
| | 297 | list_filter = ('submit_date',) |
|---|
| | 298 | date_hierarchy = 'submit_date' |
|---|
| | 299 | search_fields = ('comment', 'person_name') |
|---|
| | 300 | |
|---|
| | 301 | admin.site.register(Comment, CommentAdmin) |
|---|
| | 302 | admin.site.register(FreeComment, FreeCommentAdmin) |
|---|