miniblog.forms

class miniblog.forms.EntryForm(formdata=None, obj=None, prefix='', **kwargs)[source]

Form for adding an entry.

Notices that the choices need to be specifically added upon recieving a request:

Also for proper HTML5 usage, it is recommended to set the required attribute for EntryForm.title and EntryForm.text:

This is most likely done in the template (e.g. templates/add.mako).

Attrs:

title: Title of the blog post. Required.

text: Full text. Supports Markdown (see ...)

Todo

Insert ref to Markdown explanation.

category: A list of categories, needs to be instantiated newly for each request as it is dynamic.

submit: This button is pressed if a new article should be saved. Check for it with form.submit.data (either True or False).

preview: This button is pressend when the article should not be saved but instead rendered and shown. See submit for usage.

class miniblog.forms.CategoryForm(formdata=None, obj=None, prefix='', **kwargs)[source]

Very simple form to add a category. Just enter a name and hit ‘Save’.

Attrs:

name: The name of the category.

submit: Button that is pressed to save new category.

Previous topic

miniblog.views

This Page