ToscaWidgets 2的运行时组件,一个Web小部件工具包。
项目描述
ToscaWidgets是一个用于Python的Web小部件工具包,用于协助创建、打包和分发在Web中通常使用的常见视图元素。
import tw2.core as twc class HelloWidget(twc.Widget): inline_engine_name = "kajiki" template = """ <i>Hello ${w.name}</i> """ name = twc.Param(description="Name of the greeted entity") >>> HelloWidget(name="World").display() <i>Hello World</i>
tw2.core包轻量级,提供ToscaWidgets的运行时,所有与表单相关的机制都由tw2.forms提供。
import tw2.core as twc import tw2.forms as twf class MovieForm(twf.Form): class child(twf.TableLayout): title = twf.TextField() director = twf.TextField(value='Default Director') genres = twf.SingleSelectField(options=['Action', 'Comedy', 'Romance', 'Sci-fi']) action = '/save_movie'
构建状态
分支 |
构建状态 |
测试覆盖率 |
---|---|---|
master |
||
develop |
文档
文档托管在ReadTheDocs。