mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 08:04:26 -04:00
fix admin registration using abx hooks
This commit is contained in:
parent
30923c340f
commit
c0b7887fd7
13 changed files with 253 additions and 1006 deletions
|
@ -1,28 +1,28 @@
|
|||
# __package__ = 'archivebox.crawls'
|
||||
__package__ = 'archivebox.crawls'
|
||||
|
||||
# import abx
|
||||
import abx
|
||||
|
||||
# from abid_utils.admin import ABIDModelAdmin
|
||||
from abid_utils.admin import ABIDModelAdmin
|
||||
|
||||
# from .models import Crawl
|
||||
from crawls.models import Crawl
|
||||
|
||||
|
||||
|
||||
# class CrawlAdmin(ABIDModelAdmin):
|
||||
# list_display = ('abid', 'created_at', 'created_by', 'depth', 'parser', 'urls')
|
||||
# sort_fields = ('abid', 'created_at', 'created_by', 'depth', 'parser', 'urls')
|
||||
# search_fields = ('abid', 'created_by__username', 'depth', 'parser', 'urls')
|
||||
class CrawlAdmin(ABIDModelAdmin):
|
||||
list_display = ('abid', 'created_at', 'created_by', 'depth', 'parser', 'urls')
|
||||
sort_fields = ('abid', 'created_at', 'created_by', 'depth', 'parser', 'urls')
|
||||
search_fields = ('abid', 'created_by__username', 'depth', 'parser', 'urls')
|
||||
|
||||
# readonly_fields = ('created_at', 'modified_at', 'abid_info')
|
||||
# fields = ('urls', 'depth', 'parser', 'created_by', *readonly_fields)
|
||||
readonly_fields = ('created_at', 'modified_at', 'abid_info')
|
||||
fields = ('urls', 'depth', 'parser', 'created_by', *readonly_fields)
|
||||
|
||||
# list_filter = ('depth', 'parser', 'created_by')
|
||||
# ordering = ['-created_at']
|
||||
# list_per_page = 100
|
||||
# actions = ["delete_selected"]
|
||||
list_filter = ('depth', 'parser', 'created_by')
|
||||
ordering = ['-created_at']
|
||||
list_per_page = 100
|
||||
actions = ["delete_selected"]
|
||||
|
||||
|
||||
|
||||
# @abx.hookimpl
|
||||
# def register_admin(admin_site):
|
||||
# admin_site.register(Crawl, CrawlAdmin)
|
||||
@abx.hookimpl
|
||||
def register_admin(admin_site):
|
||||
admin_site.register(Crawl, CrawlAdmin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue