refactor: move Url.public to View.public (#1140)

* refactor: move Url.public to View.public

* refactor: fix tests / imports
This commit is contained in:
Juro Oravec 2025-04-21 23:12:40 +02:00 committed by GitHub
parent b49002b545
commit 519529d4e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 291 additions and 336 deletions

View file

@ -257,7 +257,7 @@ Next, you need to set the URL for the component.
You can either:
1. Automatically assign the URL by setting the [`Component.Url.public`](../../reference/api#django_components.ComponentUrl.public) attribute to `True`.
1. Automatically assign the URL by setting the [`Component.View.public`](../../reference/api#django_components.ComponentView.public) attribute to `True`.
In this case, use [`get_component_url()`](../../reference/api#django_components.get_component_url) to get the URL for the component view.
@ -265,7 +265,7 @@ You can either:
from django_components import Component, get_component_url
class Calendar(Component):
class Url:
class View:
public = True
url = get_component_url(Calendar)