Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Lazy route #442

Merged
merged 6 commits into from
Aug 26, 2023
Merged

Lazy route #442

merged 6 commits into from
Aug 26, 2023

Conversation

s-cork
Copy link
Collaborator

@s-cork s-cork commented Aug 11, 2023

tagging @steininge and @jshaffstall who might be interested in this one following this forum post:

https://anvil.works/forum/t/lazy-loading-for-forms/18166/2

@routing.lazy_route('article', url_keys=['id', routing.ANY], title="Article-{id} | RoutingExample")
def article_route():
    from ..ArticleForm import ArticleForm
    return ArticleForm
 

@s-cork s-cork requested a review from meatballs August 11, 2023 15:06
@jshaffstall
Copy link
Contributor

So we'd define a module full of the lazy routes, and each individual form would not have a route? I kind of like having the route information all in one place. This might become my new standard way of using routing, and not just for the loading time reduction.

@s-cork
Copy link
Collaborator Author

s-cork commented Aug 11, 2023

Yeah exactly. That would be an absolutely valid pattern.

@steininge
Copy link

I like it. Thank you, @s-cork!

@s-cork s-cork merged commit 5b55493 into main Aug 26, 2023
@s-cork s-cork deleted the lazy-route branch August 26, 2023 13:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants