0.5.12 get_tree_arts fix
This commit is contained in:
@@ -14,10 +14,12 @@ from collections import OrderedDict
|
||||
def get_tree_arts(art, arts, sel_arts_ids):
|
||||
|
||||
docs_tree = OrderedDict()
|
||||
|
||||
docs_tree.update({
|
||||
art_item.name: {
|
||||
art_item.id: {
|
||||
'url': art_item.url,
|
||||
'id': art_item.id,
|
||||
'name': art_item.name,
|
||||
# 'id': art_item.id,
|
||||
'children': get_tree_arts(art_item, arts, sel_arts_ids),
|
||||
'active': art_item.id in sel_arts_ids
|
||||
} for art_item in arts.filter(parent=art)
|
||||
|
||||
@@ -31,7 +31,9 @@ class Admin_FileUnit(Admin_Trans_BaseModelViewPage):
|
||||
fn.short_description = 'Файл'
|
||||
|
||||
def fn_full_path(self, obj):
|
||||
return obj.file.url
|
||||
from urllib.parse import unquote_plus
|
||||
res = unquote_plus(obj.file.url, encoding="utf-8")
|
||||
return res
|
||||
fn_full_path.short_description = 'Линк для использования в HTML'
|
||||
|
||||
fieldsets = [
|
||||
@@ -47,7 +49,7 @@ class Admin_FileUnit(Admin_Trans_BaseModelViewPage):
|
||||
]
|
||||
|
||||
list_display = [
|
||||
'image_thumb',
|
||||
# 'image_thumb',
|
||||
'id',
|
||||
'fn',
|
||||
'fn_full_path',
|
||||
@@ -55,7 +57,7 @@ class Admin_FileUnit(Admin_Trans_BaseModelViewPage):
|
||||
'order', 'modifiedDT', 'createDT'
|
||||
]
|
||||
|
||||
list_display_links = ['id', 'image_thumb']
|
||||
list_display_links = ['id']
|
||||
list_editable = ['order']
|
||||
|
||||
list_filter = ['modifiedDT', 'createDT']
|
||||
|
||||
@@ -34,6 +34,7 @@ X_FRAME_OPTIONS = 'SAMEORIGIN'
|
||||
# Application definition
|
||||
|
||||
FILEBROWSER_SHOW_IN_DASHBOARD = False
|
||||
LIST_PER_PAGE = 100
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'colorfield',
|
||||
|
||||
Reference in New Issue
Block a user