2 # This file is part of my.gpodder.org.
4 # my.gpodder.org is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or (at your
7 # option) any later version.
9 # my.gpodder.org is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
12 # License for more details.
14 # You should have received a copy of the GNU Affero General Public License
15 # along with my.gpodder.org. If not, see <http://www.gnu.org/licenses/>.
18 from django
.contrib
import admin
19 from django
.contrib
.auth
.models
import User
20 from mygpo
.api
.models
import *
22 class DeviceInline(admin
.TabularInline
):
26 class EpisodeInline(admin
.TabularInline
):
30 class EpisodeActionInline(admin
.TabularInline
):
34 class SubscriptionActionInline(admin
.TabularInline
):
35 model
= SubscriptionAction
38 class SyncGroupAdmin(admin
.ModelAdmin
):
39 inlines
= [DeviceInline
]
41 class UserProfileInline(admin
.StackedInline
):
44 class UserProfileAdmin(admin
.ModelAdmin
):
45 inlines
= [UserProfileInline
, DeviceInline
, EpisodeActionInline
]
47 class PodcastAdmin(admin
.ModelAdmin
):
48 inlines
= [EpisodeInline
]
49 list_display
= ['title', 'description', 'url', 'link', 'last_update', 'subscription_count']
51 class DeviceAdmin(admin
.ModelAdmin
):
52 inlines
= [SubscriptionActionInline
]
54 class SubscriptionAdmin(admin
.ModelAdmin
):
55 #empty ModelAdmin to work around bug 685
58 class SubscriptionActionAdmin(admin
.ModelAdmin
):
59 #empty ModelAdmin to work around bug 685
62 admin
.site
.unregister(User
)
63 admin
.site
.register(User
, UserProfileAdmin
)
64 admin
.site
.register(Podcast
, PodcastAdmin
)
65 admin
.site
.register(SyncGroup
, SyncGroupAdmin
)
66 admin
.site
.register(Device
, DeviceAdmin
)
67 admin
.site
.register(Subscription
, SubscriptionAdmin
)
68 admin
.site
.register(SubscriptionAction
, SubscriptionActionAdmin
)
69 admin
.site
.register(EpisodeAction
)
70 admin
.site
.register(URLSanitizingRule
)