Repository navigation
AirForm 0.4.1
AirForm 0.4.1: Fix html for Jinja2 compatibility
SafeHTML.__html__ is now a method that returns the HTML string, not a boolean attribute. Jinja2 and MarkupSafe call obj.__html__() and expect a string back. The 0.4.0 release had __html__ = True, which raised TypeError: 'bool' object is not callable when Jinja2 tried to auto-escape form output.
uv add AirForm --upgradeWhat's fixed
{{ form.render() }}works in Jinja2 templates without|safe. MarkupSafe'sescape()callsobj.__html__()to get trusted HTML. The method returnsstr(self), satisfying both Jinja2/MarkupSafe (calls it) and Air's tag system (checkshasattr).
Contributors
@audreyfeldroy (Audrey M. Roy Greenfeld) built this release. Bug discovered by the feldroy.com integration in a parallel session.