- Latest Recipes
+ Latest Recipes
{% for recipe in recipes %}
{% live_component "RecipeCard" with id = recipe.id & recipe = recipe %}
diff --git a/examples/views/recipes/recipes.py b/examples/views/recipes/recipes.py
index 9777579..31c101a 100644
--- a/examples/views/recipes/recipes.py
+++ b/examples/views/recipes/recipes.py
@@ -1,6 +1,6 @@
from pyview import LiveView, LiveViewSocket
-from dataclasses import dataclass, field
-from .recipe_db import Recipe, all_recipes
+from dataclasses import dataclass
+from .recipe_list import Recipe, all_recipes
@dataclass
@@ -29,6 +29,4 @@ async def handle_event(self, event, payload, socket):
id = payload["id"]
recipe = next((r for r in socket.context.recipes if r.id == id), None)
if recipe is not None:
- print("Set rating", recipe.rating, "to", payload["rating"])
-
recipe.rating = int(payload["rating"])
diff --git a/pyview/live_component/live_components_context.py b/pyview/live_component/live_components_context.py
index 39bf74f..831d5b2 100644
--- a/pyview/live_component/live_components_context.py
+++ b/pyview/live_component/live_components_context.py
@@ -31,15 +31,11 @@ def register_component(
id = f"{user_id}-{component.__class__.__name__}"
ref = ComponentReference(id, self.cid_index)
- print("Registering component", id, ref)
for c in self.components:
if c.ref.id == id:
c.context = context
- print("Component already registered", id)
return c.ref
- print("Component not registered", id)
-
self.components.append(LiveComponentContext(ref, component, context))
self.cid_index += 1
return ref