Django
1728 浏览 6 years, 1 month
6 表单 Forms
版权声明: 转载请注明出处 http://www.codingsoho.com/There are three different things that you really don't want to get confused in Django:
The model field controls what goes into the database, and when using the automatic form creation features, the model field type will give you a form containing a certain form field.
The form widgets control the HTML that the user interacts with in the form. For some form field types there might be more than one widget that could work (i.e. the time & date widgets admin uses versus the ones that are normally in user created forms).
- fields core-field-arguments | built-in-field-classes
- widgets built-in-widgets
Widget Type
- PasswordInput : A password text field.
- HiddenInput : A hidden input field
- Textarea : A text area that enables text entry on multiple lines
- FileInput : A file upload field