开发者

django form based on model

开发者 https://www.devze.com 2023-01-06 03:59 出处:网络
In http://docs.djangoproject.com/en/1.2/topics/forms/modelforms/#a-full-example can anyone tell me the step by step process to map the AuthorForm and Bookform in my views.py开发者_如何学运维 and to re

In http://docs.djangoproject.com/en/1.2/topics/forms/modelforms/#a-full-example can anyone tell me the step by step process to map the AuthorForm and Bookform in my views.py开发者_如何学运维 and to render it in my template.


The process is the same as with a regular Form (http://docs.djangoproject.com/en/dev/topics/forms/), a ModelForm is basically just a shortcut and more DRY approach than creating a regular Form when that form's purpose is to create or edit a model instance.

0

精彩评论

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