We’ve just released Anvil Extras v2.0.0 with:
Breaking Changes
-
routing.load_form()
was removed. Userouting.set_url_hash()
instead.
This is our first breaking change (hence this being version 2.0 rather than 1.10). If you have apps using routing.load_form()
, you should ensure that the dependency is pinned to version 1.9 and only upgrade once you have changed all instances of that call to routing.set_url_hash()
New Features
- Popovers - supports changing the default container to something other than
"body"
adddismiss_on_scroll()
andset_default_container()
methods - Quill - adds a sanitize property and a sanitize kwarg to the
set_html()
method - routing - adds support for multiple top level forms
-
@routing.template(path='', priority=0, condition=None)
A template form is a top level form that holds the header, navigation bar, side panel and an emptycontent_panel
.
When navigating the routing module will ensure the correct template is the currentopen_form
based on thepriority
,path
, andcondition
. The currenturl_hash
must start with thepath
, and if acondition
is set it must returnTrue
.
Templates are checked order of priority, highest values first. -
@routing.default_template
replaces@routing.main_router
.
The@main_router
decorator is still available.@default_template
is equivalent to@template()
-
routing.NavigationExit()
when raised within atemplate
'son_navgation
callback, this will prevent therouting
module from changing thecontent_panel
.
This is useful if you have aLoginForm
as atemplate
whose content should remain unchanged when the user tries to navigate to otherroutes
. -
routing.launch()
called within a startup module, replaces the call toopen_form()
.
routing.launch()
checks the currenturl_hash
and ensures that the correct template is loaded based on the paramaters of each template.
Callingrouting.set_url_hash()
in a Startup Module will have no effect on form loading untilrouting.launch()
has been called. (This allows you to change theurl_hash
within the startup logic)
-
-
logging
module
Small, simple, lightweight API for logging in anvil apps, a bit like the Python logging module.
See the docs:-
Logger
Logging — Anvil Extras documentation -
TimerLogger
Logging — Anvil Extras documentation
-
Bug fixes
- Multi-select - fix button clicks don’t always close the dropdown menu
- fix bug with
@timed
decorator if used with keyword logger and level arguments