Пример #1
0
class LocationForm(widget.FieldSet):
    _fields = ["city", "state", "address"]
    cls = "location"

    city = widget.Input()
    state = widget.Input()
    address = AddressForm()
Пример #2
0
class SimpleForm(widget.Form):
    _fields = ["name", "age", "phone"]
    name = widget.Input(label="Name")
    age = widget.Input(
        label="Age",
        description="This is today minus the date you were born in seconds.")
    phone = widget.Input(label="Phone")
Пример #3
0
class PersonForm(widget.Form):
    _action = '/save_person'
    _id = "person_woot"
    #if anyone knows a better way to maintain the order of the fields, please let me know!
    _fields = ["human_id", "name", "age", "location"]

    human_id = widget.Input(label="ID")
    name = widget.Input(label="Name")
    age = widget.Input(label="Age", description="This is today minus the date you were born in seconds.")
    location = LocationForm(label="Location")
Пример #4
0
class HumanForm(widget.Form):
    #if anyone knows a better way to maintain the order of the fields, please let me know!
    _fields = ["name", "age", "weight", "location"]

    name = widget.Input(label="Name")
    age = widget.Input(
        label="Age",
        description="This is today minus the date you were born in seconds.")
    weight = widget.Input(label="Weight")
    location = LocationForm(label="Location")
Пример #5
0
class PersonForm(widget.Form):
    action = '/save_person'
    id = "person_%s" % chris._id
    _prepend = "test"
    #if anyone knows a better way to maintain the order of the fields, please let me know!
    _fields = ["human_id", "name", "age", "car", "location", "jobs", "email"]

    human_id = widget.Input(label="ID")
    name = widget.Input(label="Name")
    age = widget.Input(
        label="Age",
        description="This is today minus the date you were born in seconds.")
    car = widget.Select(label="Car", item_render=car_disp)
    location = LocationForm(label="Location")
    jobs = widget.MultipleSelect(label="Jobs", item_render=job_list)
    email = widget.Input(label="Email")
Пример #6
0
class LocationForm(widget.FieldSet):
    _fields = ["city"]
    _cls = "location"

    city = widget.Input()
Пример #7
0
class AddressForm(widget.FieldSet):
    _fields = ["street", "street2", "zip"]

    street = widget.Input()
    street2 = widget.TextArea(cls="Woot", rows=10, cols=30)
    zip = widget.Input()
Пример #8
0
class LocationForm(widget.FieldSet):
    _fields = ["city", "address"]

    city = widget.Input(label="City")
    address = AddressForm(label="Address")
Пример #9
0
class AddressForm(widget.FieldSet):
    _fields = ["street", "zip"]

    street = widget.Input(label="Street")
    zip = widget.Input(label="Zip")
Пример #10
0
 def test_input_render(self):
     text = widget.Input(object=self.car._get("make"),
                         name="make").render(cls="red checked")
     self.assertEqual(text.strip(), self.text_html.strip())