'Returns a string with a HTML <select> for the given dictionary,
where each dict item is an <option value="key">value</option>.'

def select(self, options={}, selected=None, **attributes):

    a = [('<select%s>\n' % self._attrs(**attributes))]
    for (k, v) in sorted(options.items()):
        if (k == selected):
            a.append((' DCTB <option    value="%s"    selected>%s</option>\n' % (k, v)))
        else:
            a.append((' DCTB <option    value="%s">%s</option>\n' % (k, v)))
    a.append('</select>\n')
    return ''.join(a)
