示例#1
0
 def submit_file(self, rdata, files, user):
     form = FileForm(rdata, files)
     if form.is_valid():
         form.send()
         return Msg(form.cleaned_data['file'].size)
     else:
         return Error(form.get_errors())
示例#2
0
 def submit(self, rdata, user):
     form = FeedbackForm(rdata)
     if form.is_valid():
         form.send()
         return Msg('Thank you for feedback.')
     else:
         return Error(form.get_errors())
示例#3
0
 def hello(self, username, user):
     return Msg(u'Hello, %s!' % username)
示例#4
0
 def log_something(self, msg, user):
     print(msg)
     return Msg('OK')
示例#5
0
 def func1(self, val, d='default', *args, **kwargs):
     print('val =', val)
     print('d =', d)
     print('args =', args)
     print('kwargs =', kwargs)
     return Msg('func1')
示例#6
0
 def func1(self, user, request):
     return Msg(u'func1')
示例#7
0
 def func5(self, user, request):
     return Msg(u'func5')
示例#8
0
 def func4(self, user, request):
     return Msg(u'func4')
示例#9
0
 def func3(self, user, request):
     return Msg(u'func3')
示例#10
0
 def func2(self, val, **kwargs):
     return Msg(u'func2')
示例#11
0
 def func1(self, val, d='default', *args, **kwargs):
     print 'val =', val
     print 'd =', d
     print 'args =', args
     print 'kwargs =', kwargs
     return Msg(u'func1')