home / docs / sections

sections: internals:internals-formdata

This data as json

id page ref title content breadcrumbs references
internals:internals-formdata internals internals-formdata The FormData class await request.form() returns a FormData object - a dictionary-like object which provides access to form fields and uploaded files. It has a similar interface to MultiParams . form[key] - string or UploadedFile Returns the first value for that key, or raises a KeyError if the key is missing. form.get(key) - string, UploadedFile, or None Returns the first value for that key, or None if the key is missing. Pass a second argument to specify a different default. form.getlist(key) - list Returns the list of values for that key. If the key is missing an empty list will be returned. form.keys() - list of strings Returns the list of available keys. key in form - True or False You can use if key in form to check if a key is present. for key in form - iterator This lets you loop through every available key. len(form) - integer Returns the total number of submitted values. ["Internals for plugins"] []
Powered by Datasette · Queries took 4.54ms