Log in as guest/misc to create tickets


'A La Mode' is a helper module for web apps. I use it with CherryPy (hence the name), but it isn't CherryPy-specific at all. It provides:

  • AdapterFromHTML and AdapterToHTML classes. Call to_html or from_html.coerce(value). These can be extended to handle arbitrary types. Two new types, "inttuple" and "strtuple" are included.
  • coerce_in(paramMap, key, type, [default]) and coerce_out(obj, [attr], [default]) functions, which use the adapters.
  • checked(truth_value) and selected(truth_value) functions for generating the HTML attributes checked='checked' and selected='selected'.
  • Miscellaneous HTML quoting helpers: escape_url, escape/unescape_spaces, parse_date, sane_year, quote, urljoin.