Автоматическая ширина эдитора
Добавил автоматическую установку ширины в inplace edit
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user