tg.defaultview = "genshi"
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi :include href="master.html" />
old: <head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'" py:attrs="item.items()">
new: <head py:match="head" py:attrs="select('@*')">
old: <meta py:replace="item[:]"/>
new: <meta py:replace="select('*')" />
old: <body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()">
new: <body py:match="body" py:attrs="select('@*')">
old: <div py:replace="[item.text]+item[:]"/>
new: <div py:replace="select('*|text()')" />
from toscawidgets.core import WidgetsList
from toscawidgets.widgets.forms import TextField, HiddenField, SingleSelectField, TableForm, TextArea, RadioButtonList
from formencode.schema import Schema
...
class FilteringSchema(Schema):
filter_extra_fields = True
allow_extra_fields = True
class ProjectorFields(WidgetsList):
test1 = TextField(validator=validators.NotEmpty(), label="Test 1:")
test2 = TextField(validator=validators.NotEmpty(), label="Test 2:")
form = TableForm("testform", validator=FilteringSchema, fields=TestFormFields(), action="testform", submit_text="Submit")
old: py:attrs="selected=tg.selector(id == testid)"
new: py:attrs="{'selected': tg.selector(id == testid)}"
posted at: 01:56 | path: /turbogears | permanent link to this entry