ActionAdmin   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 10
wmc 0
1
from django.contrib import admin
2
3
from actstream import models
4
5
# Use django-generic-admin widgets if available
6
try:
7
    from genericadmin.admin import GenericAdminModelAdmin as ModelAdmin
8
except ImportError:
9
    ModelAdmin = admin.ModelAdmin
10
11
12
class ActionAdmin(ModelAdmin):
13
    date_hierarchy = 'timestamp'
14
    list_display = ('__str__', 'actor', 'verb', 'target', 'public')
15
    list_editable = ('verb',)
16
    list_filter = ('timestamp',)
17
    raw_id_fields = ('actor_content_type', 'target_content_type',
18
                     'action_object_content_type')
19
20
21
class FollowAdmin(ModelAdmin):
22
    list_display = ('__str__', 'user', 'follow_object', 'actor_only', 'started')
23
    list_editable = ('user',)
24
    list_filter = ('user', 'started',)
25
    raw_id_fields = ('user', 'content_type')
26
27
28
admin.site.register(models.Action, ActionAdmin)
29
admin.site.register(models.Follow, FollowAdmin)
30