from django.contrib import admin

from .models import Feed, Entry, UserEntryState

admin.site.register(Feed)
admin.site.register(Entry)
admin.site.register(UserEntryState)

@@ -25,16 +25,58 @@
 rt admin
+%0Afrom django.utils.html import format_html
 %0A%0Afrom .
@@ -122,93 +122,1679 @@
 te%0A%0A
-admin.site.register(Feed)%0Aadmin.site.register(Entry)%0Aadmin.site.register(UserEntryState)
+%0Adef url(short_description, urlfield):%0A    def url_display(obj):%0A        url = getattr(obj, urlfield)%0A        return format_html('%3Ca href=%22%7Burl%7D%22%3E%7Burl%7D%3C/a%3E', url=url)%0A    url_display.allow_tags = True%0A    url_display.admin_order_field = urlfield%0A    url_display.short_description = short_description%0A%0A    return url_display%0A%0A%0A@admin.register(Feed)%0Aclass FeedAdmin(admin.ModelAdmin):%0A    list_display = ('name', url('URL', 'url'),)%0A    search_fields = ('name',)%0A%0A%0A@admin.register(Entry)%0Aclass EntryAdmin(admin.ModelAdmin):%0A    list_display = ('feed_name', 'title', url('Link', 'link'), 'time',)%0A    list_display_links = ('feed_name', 'title',)%0A    list_filter = ('time',)%0A    date_hierarchy = 'time'%0A    search_fields = ('feed__name', 'title', 'content',)%0A%0A    def feed_name(self, entry):%0A        return entry.feed.name%0A    feed_name.short_description = 'Feed'%0A    feed_name.admin_order_field = 'feed__name'%0A%0A%0A@admin.register(UserEntryState)%0Aclass UserEntryStateAdmin(admin.ModelAdmin):%0A    list_display = (%0A        'user', 'feed', 'entry_title',%0A        'read', 'expanded', 'opened', 'starred',%0A    )%0A    list_display_links = ('user', 'feed', 'entry_title',)%0A    list_filter = ('read', 'expanded', 'opened', 'starred',)%0A    list_select_related = ('user', 'entry', 'entry__feed',)%0A    search_fields = ('entry__title',)%0A%0A    def feed(self, user_entry_state):%0A        return user_entry_state.entry.feed.name%0A    feed.short_description = 'Feed'%0A    feed.admin_order_field = 'entry__feed__name'%0A%0A    def entry_title(self, user_entry_state):%0A        return user_entry_state.entry.title%0A    entry_title.short_description = 'Entry'%0A    entry_title.admin_order_field = 'entry__title'
 %0A

Customize admin