[Twisted-web] newbie: Stan syntax question
Mohamed Lrhazi
mohamed at your-site.com
Tue Dec 14 13:30:51 MST 2004
Hello again,
I just spent sometime trying to figure this one out by myself... but could
not :(
How do you build a table dynamically, or any other stan structure for that
matter? Here is what I am trying to do:
def render_tasks(self, context, data):
attrs = ['task_id', 'task', 'arguments']
mytrs=T.tr
for row in self.tasklist:
for attr in attrs:
mytrs += T.td[row.get(attr)]
header_tr=T.tr[T.th["ID"],T.th["Task"],T.th["Arguments"]]
mytable=T.table[header_tr,(mytrs)]
return context.tag[mytable]
This gives: exceptions.TypeError: cannot concatenate 'str' and 'Tag' objects
I tried many other different ways to no avail....
I guess my question is how do you build the document dynamically, adding,
inserting into it?
Sorry for my newbie questions...
Mohamed~
More information about the Twisted-web
mailing list