None
@view_config(renderer="templates/form.pt", name="file_readonly")
@demonstrate("File Upload Widget (read-only)")
def file_readonly(self):
class Schema(colander.Schema):
upload = colander.SchemaNode(
deform.FileData(),
widget=deform.widget.FileUploadWidget(tmpstore, readonly=True),
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
appstruct = {"upload": {"uid": "123", "filename": "leavesofgrass.png"}}
return self.render_form(
form, appstruct=appstruct, success=tmpstore.clear
)