We’ve just released Anvil Extras v2.5.0.
If you’re using the new Beta Drag-and-drop Designer with anvil-extras components then we strongly recommend moving to v2.5.0.
We had to make a few changes to the way some of anvil-extras components work inside the beta designer.
New Features
authorisation
module- adds
check_permissions
andhas_permission
functions
- adds
routing.lazy_route
- allows you to lazily load Forms whilst using routing (see below)
Autocompletion
- adds
filter_mode
property - either"contains"
or"startswith"
- adds
navigation
moduleset_mode("hash")
can be used to set the default navigation mode to hash routing- menu definition can include
title
, rather than registering a form with a title - set menu item visibility using conditions defined in the menu definition (see docs)
- view transitions
routing
andnavigation
use a transition on page changes (can be turned off)
- Progress Bars
- support dynamic property changes
Bug Fixes
Pivot
component- doesn’t fail if
self.items
is not set
- doesn’t fail if
routing
alerts (docs)- was no longer dismissing alerts on navigation
- you will now need to use
routing.alert
in place ofanvil.alert
for an alert to be dismissed on navigation - non-dismissible alerts will block the navigation (as before)
Tabs
component- ensure the selected tab indicator adjusts when the tab component changes size
Minor Changes
Slider
- improve behaviour in the designer
wait_for_writeback
- is now written in pure python
Switch
- improve behaviour in the designer
routing.lazy_route
A new decorator inspired by this thread on the forum:
from anvil_extras import routing
@routing.lazy_route('')
def home_route():
from ..HomeForm import HomeForm
return HomeForm
@routing.lazy_route('articles')
def article_route():
from ..ArticleForm import ArticleForm
return ArticleForm
This means you can define all your routes in a single module (if you prefer)