forms.Form

class Form [source] To create an unbound Form instance, simply instantiate the class: >>> f = ContactForm() To bind data to a form, pass the data as a dictionary as the first parameter to your Form class constructor: >>> data = {'subject': 'hello', ... 'message': 'Hi there', ... 'sender': 'foo@example.com', ... 'cc_myself': True} >>> f = ContactForm(data) In this dictionary, the keys are the field names, which correspond to the attributes

forms.FloatField

class FloatField(**kwargs) [source] Default widget: NumberInput when Field.localize is False, else TextInput. Empty value: None Normalizes to: A Python float. Validates that the given value is a float. Leading and trailing whitespace is allowed, as in Python’s float() function. Error message keys: required, invalid, max_value, min_value Takes two optional arguments for validation, max_value and min_value. These control the range of values permitted in the field.

forms.FilePathField.recursive

recursive If False (the default) only the direct contents of path will be offered as choices. If True, the directory will be descended into recursively and all descendants will be listed as choices.

forms.FilePathField.path

path The absolute path to the directory whose contents you want listed. This directory must exist.

forms.FilePathField.match

match A regular expression pattern; only files with names matching this expression will be allowed as choices.

forms.FilePathField.allow_folders

allow_folders Optional. Either True or False. Default is False. Specifies whether folders in the specified location should be included. Either this or allow_files must be True.

forms.FilePathField.allow_files

allow_files Optional. Either True or False. Default is True. Specifies whether files in the specified location should be included. Either this or allow_folders must be True.

forms.FilePathField

class FilePathField(**kwargs) [source] Default widget: Select Empty value: None Normalizes to: A unicode object Validates that the selected choice exists in the list of choices. Error message keys: required, invalid_choice The field allows choosing from files inside a certain directory. It takes five extra arguments; only path is required: path The absolute path to the directory whose contents you want listed. This directory must exist. recursive If False (the default) only the

forms.FileInput

class FileInput [source] File upload input: <input type='file' ...>

forms.FileField

class FileField(**kwargs) [source] Default widget: ClearableFileInput Empty value: None Normalizes to: An UploadedFile object that wraps the file content and file name into a single object. Can validate that non-empty file data has been bound to the form. Error message keys: required, invalid, missing, empty, max_length Has two optional arguments for validation, max_length and allow_empty_file. If provided, these ensure that the file name is at most the given length, and that validation