- Change ‘id’ argument to all form field helpers. The default value is now NotGiven rather than None. NotGiven tells WebHelpers to create an ID attribute based on the field name (formerly None did this). None suppresses the ID attribute entirely (formerly “” did this, and still does for backward compatibility). This behavior of None is consistent with other parts of WebHelpers.
- New format_exception helper to display an exception as Python would but without the traceback.
- New URL generation algorithm for Page.pager(). You can pass a callback function to the constructor, or it will fall back to pylons.url.current or routes.url_for (in that order). It will raise NotImplementedError if none of these are available.
- Don’t allow extra positional args in constructor. The implementation does nothing with them, so it shouldn’t allow them.
- Import sqlalchemy.orm as well as sqlalchemy. User Sybiam reports an error otherwise.
- Add code to work with other iterable containers, contributed by Marcin Kuzminski.
webhelpers.constants:
webhelpers.feedgenerator:
Sync with Django rev 11910. This adds GeoRSS and makes the API more extensible, as well as fixing a few bugs. (Re-added the Atom1 ‘published’ property.) (The ‘generator’ and ‘source’ properties were lost, but they weren’t working correctly anyway.)
GeoRSS usage: use the Geo* classes and add geometry=(lat, lon) to each news item. Other shapes and a (not yet implemented) Geometry class are allowed; see the source.
webhelpers.html:
New HTML.cdata() method for producing “<!![CDATA[ ... ]]>” sections.
The basic tag builders (HTML.a() and HTML.tag("a")) now have a _nl arg which, if true, inserts a newline between content elements and at the end of the tag for readability. Example:
HTML.a("A", "B", href="/") => '<a href="/">AB</a>'
HTML.a("A", "B", href="/", _nl=True) => '<a href="/">\nA\nB\n</a>\n'
This does not affect HTML attributes nor the higher-level tag helpers. The exact spacing is subject to change. The tag building code has been refactored to accommodate this.
webhelpers.html.tags:
webhelpers.html.tools:
webhelpers.markdown / webhelpers.html.converters:
webhelpers.media:
webhelpers.paginate:
webhelpers.pylonslib:
- webhelpers.text:
- Port several helpers from Ruby’s “stringex” package.
- urlify() converts any string to a URL-friendly equivalent.
- remove_formatting().
- If the unidecode package is installed, these two helpers will also transliterate non-ASCII characters to their closest pronounciation equvivalent in ASCII.
- Four other helpers reduce HTML entities or whitespace.