-
- Notifications
You must be signed in to change notification settings - Fork 129
Closed
Description
class ParentView(UnicornView): def mount(self): print("parent mount: request=", self.request) def foo(self): print("parent foo: request=", self.request) class ChildView(UnicornView): def mount(self): print("child mounted, parent=", self.parent) def foo(self): print("calling parent.foo()") self.parent.foo()Calling the child's foo method (e.g. by clicking a button in the child component) prints in the terminal:
parent mount: request= <WSGIRequest: GET '/parent'> child mounted, parent= <unicorn.components.parent.ParentView object at 0x7fe536d3ad90> calling parent.foo() parent foo: request= None # <-- request is None If the parent's foo method is called directly from the component, its request is set.
Metadata
Metadata
Assignees
Labels
No labels