Added encapsulate factory function to get around Django bug #15791
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common.utils import validate_path
|
||||
from common.utils import validate_path, encapsulate
|
||||
from navigation.api import register_links, register_top_menu, \
|
||||
register_model_list_columns, register_multi_item_links, \
|
||||
register_sidebar_template
|
||||
@@ -168,13 +168,13 @@ def document_exists(document):
|
||||
|
||||
register_model_list_columns(Document, [
|
||||
{'name':_(u'thumbnail'), 'attribute':
|
||||
lambda x: document_thumbnail(x)
|
||||
encapsulate(lambda x: document_thumbnail(x))
|
||||
},
|
||||
{'name':_(u'tags'), 'attribute':
|
||||
lambda x: get_tags_inline_widget_simple(x)
|
||||
encapsulate(lambda x: get_tags_inline_widget_simple(x))
|
||||
},
|
||||
{'name':_(u'metadata'), 'attribute':
|
||||
lambda x: get_metadata_string(x)
|
||||
encapsulate(lambda x: get_metadata_string(x))
|
||||
},
|
||||
])
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from django.utils.http import urlencode
|
||||
|
||||
import sendfile
|
||||
from common.utils import pretty_size, parse_range, urlquote, \
|
||||
return_diff
|
||||
return_diff, encapsulate
|
||||
from common.widgets import two_state_template
|
||||
from common.literals import PAGE_SIZE_DIMENSIONS, \
|
||||
PAGE_ORIENTATION_PORTRAIT, PAGE_ORIENTATION_LANDSCAPE
|
||||
@@ -978,7 +978,7 @@ def document_type_filename_list(request, document_type_id):
|
||||
'extra_columns': [
|
||||
{
|
||||
'name': _(u'enabled'),
|
||||
'attribute': lambda x: two_state_template(x.enabled),
|
||||
'attribute': encapsulate(lambda x: two_state_template(x.enabled)),
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user