kotti.views.form¶
Form related base views from which you can inherit.
Inheritance Diagram¶
- class kotti.views.form.AddFormView(context, request, **kwargs)[source]¶
A base form for content adding purposes.
Set self.schema_factory as with EditFormView. Also set item_type to your model class. An example:
class DocumentAddForm(AddFormView): schema_factory = DocumentSchema add = Document item_type = u'Document'
- class kotti.views.form.BaseFormView(context, request, **kwargs)[source]¶
A basic view for forms with save and cancel buttons.
- class kotti.views.form.EditFormView(context, request, **kwargs)[source]¶
A base form for content editing purposes.
Set self.schema_factory to the context’s schema. Values of fields in this schema will be set as attributes on the context. An example:
import colander from deform.widget import RichTextWidget from kotti.edit.content import ContentSchema from kotti.edit.content import EditFormView class DocumentSchema(ContentSchema): body = colander.SchemaNode( colander.String(), title=u'Body', widget=RichTextWidget(), missing=u'', ) class DocumentEditForm(EditFormView): schema_factory = DocumentSchema
- class kotti.views.form.FileUploadTempStore(request)[source]¶
A temporary storage for file file uploads
File uploads are stored in the session so that you don’t need to upload your file again if validation of another schema node fails.