[Twisted-Python] woven-bug: multiple nodes using the same model
dp at twistedmatrix.com
Wed Oct 9 13:07:03 EDT 2002
Thanks for the bug report. I have known about this issue for a while;
it's tricky otherwise I would have solved it by now. Here's the issue:
The Widget gets generated, and mutates the original Template node from
the HTML template. However, it has rendered the old data.
The controller gets some input and updates the model with some new data.
The controller sends a notification to the model telling it it has
changed, and the model forwards these notifications to all views that
want it (Widgets)
The widget then gets re-generated, but the DOM node it works on isn't
the same as it was in the template HTML, so funny things happen.
This is the same issue radix was seeing where a node would get a piece
of text inserted into it multiple times.
I think the solution is for each widget to store a copy of the original
template node, so it can operate on a fresh copy the second time; I'm
testing this change right now. Maybe I'll even write some tests.
More information about the Twisted-Python