forked from erp-dev/erp
feat: tasks for sync products and customers
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin import action
|
||||
from api_v1.models import UploadedFile
|
||||
from api_v1.models import UploadedFile, DataSync
|
||||
from .tasks import backup_database
|
||||
|
||||
|
||||
@@ -21,3 +21,13 @@ class UploadedFileAdmin(admin.ModelAdmin):
|
||||
@action(description='备份数据库')
|
||||
def backup_database(self, request, queryset):
|
||||
backup_database.delay()
|
||||
|
||||
|
||||
@admin.register(DataSync)
|
||||
class DataSyncAdmin(admin.ModelAdmin):
|
||||
list_display = ['id', 'table_name', 'page_index', 'page_size', 'total_count', 'synced_rows', 'last_ctime', 'last_rowid', 'note']
|
||||
list_filter = ['table_name', 'created_at']
|
||||
search_fields = ['table_name', 'last_rowid', 'note']
|
||||
readonly_fields = ['created_at', 'updated_at']
|
||||
date_hierarchy = 'created_at'
|
||||
ordering = ['-created_at']
|
||||
|
||||
Reference in New Issue
Block a user