                          <py:when test="field.type == 'radio'">
                            <py:for each="option in field.options">
                              <input type="checkbox" id="${field_name}_$option" name="${field_name}"
-@@ -153,7 +163,7 @@
+@@ -153,7 +162,7 @@
            <select name="group" id="group">
              <option></option>
              <py:for each="field_name in field_names" py:with="field = fields[field_name]">

+                          <select name="${constraint_name}">
+                            <option></option>
+                            <option py:for="option, parent in field.options"
+                              class="sub_$parent"
+                              selected="${option == constraint_value and 'selected' or None}">$option
+                            </option>
+                          </select>
+                        </py:when>

                       selected="${field_name == query.group or None}"
                       value="${field_name}">${field.label}</option>
             </py:for>
@@ -192,8 +201,16 @@
         <py:for each="(field_name, field), sep in separated(fields.iteritems())">
           $field_name: { type: "${javascript_quote(field.type)}", label: "${javascript_quote(field.label)}"
           <py:if test="'options' in field">, options: [
