Skip to content

Commit

Permalink
Quick formatting run
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Dec 2, 2024
1 parent 4424d59 commit 4527e9f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 23 deletions.
10 changes: 4 additions & 6 deletions docs/examples/python/configure_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

from reactpy_django import REACTPY_WEBSOCKET_ROUTE # noqa: E402

application = ProtocolTypeRouter(
{
"http": django_asgi_app,
"websocket": URLRouter([REACTPY_WEBSOCKET_ROUTE]),
}
)
application = ProtocolTypeRouter({
"http": django_asgi_app,
"websocket": URLRouter([REACTPY_WEBSOCKET_ROUTE]),
})
10 changes: 4 additions & 6 deletions docs/examples/python/configure_asgi_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
# start
from channels.auth import AuthMiddlewareStack # noqa: E402

application = ProtocolTypeRouter(
{
"http": django_asgi_app,
"websocket": AuthMiddlewareStack(URLRouter([REACTPY_WEBSOCKET_ROUTE])),
}
)
application = ProtocolTypeRouter({
"http": django_asgi_app,
"websocket": AuthMiddlewareStack(URLRouter([REACTPY_WEBSOCKET_ROUTE])),
})
4 changes: 1 addition & 3 deletions docs/examples/python/django_css_external_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
@component
def my_component():
return html.div(
html.link(
{"rel": "stylesheet", "href": "https://example.com/external-styles.css"}
),
html.link({"rel": "stylesheet", "href": "https://example.com/external-styles.css"}),
html.button("My Button!"),
)
3 changes: 1 addition & 2 deletions docs/examples/python/use_mutation_args_kwargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from reactpy_django.hooks import use_mutation


def example_mutation(value: int, other_value: bool = False):
...
def example_mutation(value: int, other_value: bool = False): ...


@component
Expand Down
4 changes: 1 addition & 3 deletions docs/examples/python/use_mutation_query_refetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,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.text, key=item.pk) for item in item_query.data
)
rendered_items = html.ul(html.li(item.text, key=item.pk) for item in item_query.data)

# Handle all possible mutation states
if item_mutation.loading:
Expand Down
4 changes: 1 addition & 3 deletions docs/examples/python/use_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ 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.text, key=item.pk) for item in item_query.data]
)
rendered_items = html.ul([html.li(item.text, key=item.pk) for item in item_query.data])

return html.div("Rendered items: ", rendered_items)

0 comments on commit 4527e9f

Please sign in to comment.