您能确认在基于类的视图的上下文中,此def clean()
替代绝对没有任何作用吗?
def clean(self):
cleaned_data = super(UserAddressForm, self).clean()
address1 = cleaned_data.get('address1')
address2 = cleaned_data.get('address2')
city = cleaned_data.get('city')
state = cleaned_data.get('state')
city = cleaned_data.get('city')
state_other = cleaned_data.get('state_other')
country = cleaned_data.get('country')
country_other = cleaned_data.get('country_other')
zipcode = cleaned_data.get('zipcode')
当我第一次学习django时,我相信: a)这个功能做了些什么, b)此验证是基于类的视图所必需的,以确认用户输入的内容不包含恶意代码。
我认为a)或b)不再正确。你可否确认? 谢谢!