Автоматическая ширина эдитора

Добавил автоматическую установку ширины в inplace edit
This commit is contained in:
2015-06-16 20:33:36 +05:00
parent bef243a2bf
commit 20f6d8eab2

View File

@@ -17,12 +17,12 @@ class EditableColumn(tables.TemplateColumn):
main_part = '' main_part = ''
if object_name == '': if object_name == '':
main_part = ''' main_part = '''
{{% inplace_edit "record.{field}" auto_height = 1 %}} {{% inplace_edit "record.{field}" auto_height = 1, auto_width = 1 %}}
''' '''
else: else:
main_part = ''' main_part = '''
{{% if record.{object_name} %}} {{% if record.{object_name} %}}
{{% inplace_edit "record.{object_name}.{field}" auto_height = 1 %}} {{% inplace_edit "record.{object_name}.{field}" auto_height = 1, auto_width = 1 %}}
{{% endif %}} {{% endif %}}
''' '''
template = template.format(main_part = main_part) template = template.format(main_part = main_part)