[Twisted-Python] Woven, using microdom.lmx, and HTTP requests

Hegedus, Matthew S matthew.s.hegedus at lmco.com
Thu Oct 30 19:48:07 EST 2003


Well it's almost the weekend and this is my work email, so I must kick off a
few questions before I leave. Let me start off by thanking you all again for
being so helpful. I recognize you are busy people, so for taking time to
help me and others, I salute you ;).

Up to this point I've coded up a Twisted test program that has a global list
of lists:

  ex: [['a','b','c'],['d','e','f'],['g','h','i'], ...]

I generate dynamic xhtml, creating a form(method='get') containing a table
for my list data. Each sublist is a row of this table, and at the end of
each row (also a part of the table) is a 'REMOVE' button.

  Microdom.lmx code for 'REMOVE' button: 
      tr.td().input(type='submit', \
                    name=str(buttonID), \
                    value="REMOVE", \
                    view='rmExercise', \
                    model='listData')

... The corresponding view code for the buttons:

      def wvupdate_rmExercise(self, request, node, listData):
          print request.args
          print request.args.keys()
          if ~pseudocode~ request.args.keys()[0] is valid ~psuedocode~:
              del listData[int(request.args.keys()[0])]
              request.args.clear()

The page with the table gets served up and looks ok, but strange things
happen (unexpected HTTP events) when I hit the browser's reload button. I
can get into situations where hitting reload will generate three input
submit events as if I clicked my remove button three times. This events lead
to the deletion of a few sublists. What in the world could be going on?

Another question: When the input buttons view is called, list data is
modified, but the page does not get re-rendered. Is adding the line...

      self.render(request)

...the correct way to handle this issue?

And another question: I am browsing the pages on the same machine that I'm
serving them from. It seems that sometimes reloading the page in the browser
takes a while (more than 10 seconds in some cases). Is there some reason for
this?

Thanks again,
Matthew




More information about the Twisted-Python mailing list