I have mail.py file:
# coding: utf-8
from ..lib.common import *
from ..lib.common import _
from ..lib.forms import *
import os
log = logging.getLogger(__name__)
class mail(BaseHandler):
@view_config(route_name="mail", renderer="mail/mail.mako")
def index(self):
return {
'mail':mail
}
@view_config(route_name="send")
def send(request):
data = request.params['in']
return Response(str(data))
and mail.maco:
## coding: utf-8
<%inherit file="../base.mako" />
<form action="${request.route_url('send')}" method="post">
<input type="text" name="in" size="50">
<input type="submit" value="SEND" >
</form>
I want to get ‘in”s text. But when i press send button pyramid show me error:
AttributeError: 'mail' object has no attribute 'params'
If i write
Response('some text')
everything works great and text shows, but i want to get input text. Why do I get this error?

Your
send()method is lacking theselfparameter. (At least I’m guessing it is supposed to be a method. Since the indentation of your post is wrong, I can’t tell.)