Я пытаюсь использовать многострочный %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
Как включить многострочный % в файлы Bottle SimpleTemplate .tpl? ⇐ Python
Программы на Python
-
Anonymous
1766446031
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)))
Подробнее здесь: [url]https://stackoverflow.com/questions/79853275/how-do-you-include-multiline-in-bottle-simpletemplate-tpl-files[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия