diff --git a/docs/examples/python/use-mutation-query-refetch.py b/docs/examples/python/use-mutation-query-refetch.py index 58f48f1d..b0817713 100644 --- a/docs/examples/python/use-mutation-query-refetch.py +++ b/docs/examples/python/use-mutation-query-refetch.py @@ -26,7 +26,7 @@ def submit_event(event): elif item_query.error or not item_query.data: rendered_items = html.h2("Error when loading!") else: - rendered_items = html.ul(html.li(item, key=item) for item in item_query.data) + rendered_items = html.ul(html.li(item, key=item.pk) for item in item_query.data) # Handle all possible mutation states if item_mutation.loading: diff --git a/docs/examples/python/use-query.py b/docs/examples/python/use-query.py index e546ed59..cd8d171b 100644 --- a/docs/examples/python/use-query.py +++ b/docs/examples/python/use-query.py @@ -17,6 +17,8 @@ def todo_list(): elif item_query.error or not item_query.data: rendered_items = html.h2("Error when loading!") else: - rendered_items = html.ul([html.li(item, key=item) for item in item_query.data]) + rendered_items = html.ul( + [html.li(item, key=item.pk) for item in item_query.data] + ) return html.div("Rendered items: ", rendered_items) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 28703b37..bee85cc1 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -124,13 +124,7 @@ watch: site_name: ReactPy-Django site_author: Archmonger site_description: It's React, but in Python. Now with Django integration. -copyright: '© -
- -Reactive Python and affiliates. -' +copyright: '©
Reactive Python and affiliates. ' repo_url: https://github.com/reactive-python/reactpy-django site_url: https://reactive-python.github.io/reactpy-django repo_name: ReactPy Django (GitHub) diff --git a/docs/src/reference/template-tag.md b/docs/src/reference/template-tag.md index a8903040..759aa8cf 100644 --- a/docs/src/reference/template-tag.md +++ b/docs/src/reference/template-tag.md @@ -28,7 +28,7 @@ Each component loaded via this template tag will receive a dedicated WebSocket c | `#!python *args` | `#!python Any` | The positional arguments to provide to the component. | N/A | | `#!python class` | `#!python str | None` | The HTML class to apply to the top-level component div. | `#!python None` | | `#!python key` | `#!python Any` | Force the component's root node to use a [specific key value](https://reactpy.dev/docs/guides/creating-interfaces/rendering-data/index.html#organizing-items-with-keys). Using `#!python key` within a template tag is effectively useless. | `#!python None` | - | `#!python host` | `#!python str | None` | The host to use for the ReactPy connections. If unset, the host will be automatically configured.
Example values include: `localhost:8000`, `example.com`, `example.com/subdir` | `#!python None` | + | `#!python host` | `#!python str | None` | The host to use for ReactPy connections. If unset, the host will be automatically configured.
Example values include: `localhost:8000`, `example.com`, `example.com/subdir` | `#!python None` | | `#!python prerender` | `#!python str` | If `#!python "true"` the component will pre-rendered, which enables SEO compatibility and reduces perceived latency. | `#!python "false"` | | `#!python offline` | `#!python str` | The dotted path to a component that will be displayed if your root component loses connection to the server. Keep in mind, this `offline` component will be non-interactive (hooks won't operate). | `#!python ""` | | `#!python **kwargs` | `#!python Any` | The keyword arguments to provide to the component. | N/A | diff --git a/src/reactpy_django/templatetags/reactpy.py b/src/reactpy_django/templatetags/reactpy.py index d6d5ad5d..e33d8387 100644 --- a/src/reactpy_django/templatetags/reactpy.py +++ b/src/reactpy_django/templatetags/reactpy.py @@ -51,7 +51,7 @@ def component( class: The HTML class to apply to the top-level component div. key: Force the component's root node to use a specific key value. Using \ key within a template tag is effectively useless. - host: The host to use for the ReactPy connections. If set to `None`, \ + host: The host to use for ReactPy connections. If set to `None`, \ the host will be automatically configured. \ Example values include: `localhost:8000`, `example.com`, `example.com/subdir` prerender: Configures whether to pre-render this component, which \ diff --git a/src/reactpy_django/utils.py b/src/reactpy_django/utils.py index 86dd64b4..457caf47 100644 --- a/src/reactpy_django/utils.py +++ b/src/reactpy_django/utils.py @@ -277,7 +277,7 @@ def django_query_postprocessor( # `QuerySet`, which is an iterable of `Model`/`QuerySet` instances # https://github.com/typeddjango/django-stubs/issues/704 - if isinstance(data, QuerySet): # type: ignore[misc] + if isinstance(data, QuerySet): for model in data: django_query_postprocessor( model,