Accessing form fields as properties in a django view

后端 未结 4 620
时光说笑
时光说笑 2020-12-29 09:01

According to the Django tutorial, you should access form fields using cleaned_data dictionary. I\'m wondering why I can\'t access the properties of the form directly? My for

4条回答
  •  一向
    一向 (楼主)
    2020-12-29 09:40

    You can access your field trought dict.

    form.__dict__["fields"]["description"]
    

提交回复
热议问题