示例#1
0
文件: threads.py 项目: drew/seddit
view = web.template.render('app/views/threads/', cache=config.cache)
person = auth.getuser()

def getquestion():
    input = web.input()
    try:
        if input.question:
            return input.question
        else:
            return ''
    except AttributeError:
        pass
        
qform = form.Form(
    form.Dropdown('rooms', [(r.id, r.title) for r in rooms.getrooms()]),
    form.Textbox('summary', form.notnull, size = 50),
    form.Textarea('question', value=getquestion(),
        cols = 50, rows = 20),
)

commentform = form.Form(
    form.Textarea('comment', form.notnull,
        cols=40, rows=10),
    form.Hidden('author_id', value=person.id)
)

class transcript:
    def GET(self, id):
        # TODO if a trasncript is requested for an invalid thread id, tell the user.
        print simplejson.dumps(threads.threadtranscript(id))
示例#2
0
文件: rooms.py 项目: drew/seddit
 def GET(self):
     roomlist = rooms.getrooms()
     recentthreads = threads.recent()
     print config.base.layout(view.list(roomlist, recentthreads), auth.getuser())