예제 #1
0
 def test_multiple_select(self):
     anne = objects.Female()
     anne.name = "Anne"
     anne.jobs.append(objects.Job())
     anne.jobs.append(objects.Job())
     def yo(obj):
         for i in obj:
             return {"value":i.title, "display":i.employer}
     print widget.MultipleSelect(object=anne.jobs, item_render=yo).render()
예제 #2
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")