mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-23 20:53:09 +00:00
19 lines
557 B
Python
19 lines
557 B
Python
|
|
from datetime import datetime
|
|
|
|
from django.contrib import admin
|
|
|
|
from .models import Page
|
|
|
|
class PageAdmin(admin.ModelAdmin):
|
|
list_display = ('timestamp', 'short_url', 'title', 'is_archived', 'num_outputs', 'added', 'updated', 'url_hash')
|
|
readonly_fields = ('num_outputs', 'is_archived', 'added', 'updated', 'bookmarked')
|
|
fields = ('url', 'timestamp', 'title', 'tags', *readonly_fields)
|
|
|
|
def short_url(self, obj):
|
|
return obj.url[:64]
|
|
|
|
def updated(self, obj):
|
|
return obj.isoformat()
|
|
|
|
admin.site.register(Page, PageAdmin)
|