开发者

google app engine: getting form fields

How do I get access to the form data. I want to do this before is_valid() is carried out. How do I access a field. I seem to be getting a blank address though.

The code looks like:

def post(self):
    data = C开发者_运维问答ompanyForm(data=self.request.POST)
    map_url = ''    
    address = str(data['company_postcode'])

    address = address.replace(' ', '')

whats the best way to do this?


According to the Request class documentation, Request does not have a POST instance variable. You can call self.request.get('company_postcode') to obtain the posted value for company_postcode.

For debugging, the raw POST data can be obtained from self.request.body.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜