def create_field(name, schema, validated): return t.column(t.Field, post=t.OneOf([x[0] for x in validated["choices"]]), name=name, label=validated["description"], choices=validated["choices"], widget=schema.__class__.__name__, required=validated["required"])
class PointList(t.Schema): points = t.column(t.Collection(Point))
class Pair(t.Schema): l = t.column(t.Container(Point), class_="left") r = t.column(t.Container(Point), class_="right")
class Point(t.Schema): x = t.column(t.IntegerField, label=u"x-coordinate", class_="hidden") y = t.column(t.IntegerField) z = t.column(t.IntegerField, required=False)
class Signal(t.Schema): color = t.column(t.TextField, t.OneOf(["red", "blue", "yellow"]))
class Point(t.Schema): x = t.column(t.IntegerField, label=u"цик") y = t.column(t.IntegerField) z = t.column(t.IntegerField, required=False)
class FieldParams(object): description = t.column(t.TextField) choices = t.column(t.ChoicesField) # xxx required = t.column(t.BooleanField, default=False, required=False)
class S(Schema): value = column(PositiveIntegerField)
class S(_getTarget()): x = t.column(t.IntegerField, t.positive, x="yyy")
class Signal(object): color = t.column(t.TextField, widget="select")