The presentation model for NewContent renders each row of database
data into a form. When one of these rows of database data is clicked on, I want to
temporarily replace the component with a util.Ask() instance. But
comp.call() does not do this. Instead the web browser spins forever,
waiting on the server.
By contrast, calling comp.becomes(util.Ask()) works fine.
Why can I not use comp.call() on util.Ask() and have it replace the
entire component of NewContent and then re-render newContent once
util.Ask() returns?
class NewContent(object):
def __init__(self):
pass
def data(self):
return database.session.query(
models.OBFL_Log_ParsingErrors).filter(
models.OBFL_Log_ParsingErrors.Type_Of_Record == 'Error')
def config(self, comp, dbrow):
r = comp.call(util.Ask("does she love me?"))
#r = comp.becomes(util.Ask("does she love me?"))
print "Does ask finish?"
@presentation.render_for(NewContent)
def render(self, h, comp, *args):
for le in self.data()[:100]:
with h.div:
with h.form.post_action(self.config, comp, le):
h << h.input(type='Submit', value='Delete')
h << h.input(value=le.File_ID, disabled=True)
h << h.input(value=le.File_Name, disabled=True)
h << h.input(value=le.Line_Start, disabled=True)
h << h.input(value=le.Content, disabled=True)
h << h.input(type='Submit', value='Configure')
return h.root