Как включить многострочный % в файлы Bottle SimpleTemplate .tpl?Python

Программы на Python
Ответить
Anonymous
 Как включить многострочный % в файлы Bottle SimpleTemplate .tpl?

Сообщение Anonymous »

Я пытаюсь использовать многострочный %includes в Bottle (SimpleTemplate).
Возможно ли это на самом деле?



Employees









% include('topbar', title='Employees', logo_url='../static/logo.png', menu_items=menu_items, right_items=right_items)



% include('collapsible_panel',
panel_width='300px',
collapsed=False,
panel_content=template('panel_list',
headers=['ID', 'Name', 'Department', 'Active'],
column_widths='60px 1fr 120px 80px',
items=[
{
'link': '/employees/1',
'active': True,
'cells': [
{'text': '001'},
{'text': 'John Doe'},
{'text': 'Engineering'},
{'type': 'icon', 'checked': True}
]
},
{
'link': '/employees/2',
'cells': [
{'text': '002'},
{'text': 'Jane Smith'},
{'text': 'Marketing'},
{'type': 'icon', 'checked': True}
]
},
{
'link': '/employees/3',
'cells': [
{'text': '003'},
{'text': 'Bob Johnson'},
{'text': 'Sales'},
{'type': 'icon', 'checked': False}
]
}
]
),
main_content='''
Employee Details
Select an employee from the list to view details here.
This area will show detailed information about the selected employee.
'''
)





Если вы попробуете описанное выше, вы получите:
SyntaxError(SyntaxError("'(' was never closed", ('/home/user/test/src/views/employees.tpl', 19, 8, " % include('collapsible_panel', \n", 19, 0)))


Подробнее здесь: https://stackoverflow.com/questions/798 ... -tpl-files
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»