Django Book 翻译
菜单>:
TOC
返回
原文:
First, though, we need to tell if the data is indeed valid, and if it is, we need access to the validated data. The forms framework does more than just validate the data, it also converts it into Python types. Our contact form only deals with strings, but if we were to use an ``IntegerField`` or ``DateTimeField`` , the forms framework would ensure that we got back a Python integer or ``datetime`` object, respectively.
翻译:
首先,我们需要知道用户数据是不是真的合法,如果是这样,我们就要访问已经验证过的数据。forms框架甚至做的更多,它会把它们转换成对应的Python类型。我们的联系方式form仅仅处理字符串,但是如果我们使用IntegerField或者DataTimeField,forms框架会保证我们从中取得类型正确的值。
备注:
译者: