mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-01-03 09:25:42 +10:00
This commit completes the simplification of the ID system by: - Removing the ABID (ArchiveBox ID) system entirely - Removing the base_models/abid.py file - Removing KVTag model in favor of the existing Tag model in core/models.py - Simplifying all models to use standard UUIDv7 primary keys - Removing ABID-related admin functionality - Cleaning up commented-out ABID code from views and statemachines - Deleting migration files for ABID field removal (no longer needed) All models now use simple UUIDv7 ids via `id = models.UUIDField(primary_key=True, default=uuid7)` Note: Old migrations containing ABID references are preserved for database migration history compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
__package__ = 'archivebox.api'
|
|
|
|
from signal_webhooks.admin import WebhookAdmin
|
|
from signal_webhooks.utils import get_webhook_model
|
|
|
|
from archivebox.base_models.admin import BaseModelAdmin
|
|
|
|
from api.models import APIToken
|
|
|
|
|
|
class APITokenAdmin(BaseModelAdmin):
|
|
list_display = ('created_at', 'id', 'created_by', 'token_redacted', 'expires')
|
|
sort_fields = ('id', 'created_at', 'created_by', 'expires')
|
|
readonly_fields = ('created_at', 'modified_at')
|
|
search_fields = ('id', 'created_by__username', 'token')
|
|
fields = ('created_by', 'token', 'expires', *readonly_fields)
|
|
|
|
list_filter = ('created_by',)
|
|
ordering = ['-created_at']
|
|
list_per_page = 100
|
|
|
|
|
|
class CustomWebhookAdmin(WebhookAdmin, BaseModelAdmin):
|
|
list_display = ('created_at', 'created_by', 'id', *WebhookAdmin.list_display)
|
|
sort_fields = ('created_at', 'created_by', 'id', 'referenced_model', 'endpoint', 'last_success', 'last_error')
|
|
readonly_fields = ('created_at', 'modified_at', *WebhookAdmin.readonly_fields)
|
|
|
|
|
|
def register_admin(admin_site):
|
|
admin_site.register(APIToken, APITokenAdmin)
|
|
admin_site.register(get_webhook_model(), CustomWebhookAdmin)
|