mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
修复获取下载器导致在未创建数据库时无法执行makemigrations和migrate的bug
This commit is contained in:
@@ -675,6 +675,14 @@ class DownloaderAdmin(ImportExportModelAdmin, AjaxAdmin): # instead of ModelAdm
|
||||
# print(sender.test_connect(kwargs['instance']))
|
||||
|
||||
|
||||
def get_downloader():
|
||||
"""获取下载器列表"""
|
||||
try:
|
||||
return [{'key': i.id, 'label': i.name} for i in Downloader.objects.all()]
|
||||
except Exception as e:
|
||||
return []
|
||||
|
||||
|
||||
@admin.register(TorrentInfo)
|
||||
class TorrentInfoAdmin(ImportExportModelAdmin, AjaxAdmin): # instead of ModelAdmin
|
||||
formats = (base_formats.XLS, base_formats.CSV, base_formats.JSON)
|
||||
@@ -953,13 +961,6 @@ class TorrentInfoAdmin(ImportExportModelAdmin, AjaxAdmin): # instead of ModelAd
|
||||
# time.sleep(2)
|
||||
# 可以根据request的用户,来动态设置返回哪些字段,每次点击都会来获取配置显示
|
||||
|
||||
def get_downloader(self):
|
||||
"""获取下载器列表"""
|
||||
try:
|
||||
return [{'key': i.id, 'label': i.name} for i in Downloader.objects.all()]
|
||||
except Exception as e:
|
||||
return []
|
||||
|
||||
to_download.layer = {
|
||||
# 弹出层中的输入框配置
|
||||
# 这里指定对话框的标题
|
||||
|
||||
Reference in New Issue
Block a user