| Home | Trees | Indices | Help |
|
|---|
|
|
Create an action for a form that pops up a print preview for generated html.
Overwrite the html function to customize the html that should be shown::
class PrintMovieAction(PrintHtmlFormAction):
def html(self, movie):
html = '<h1>' + movie.title + '</h1>'
html += movie.description
return html
class Movie(Entity):
title = Field(Unicode(60), required=True)
description = Field(camelot.types.RichText)
class Admin(EntityAdmin):
list_display = ['title', 'description']
form_actions = [PrintMovieAction('summary')]
will put a print button on the form :
.. image:: ../_static/formaction/print_html_form_action.png
.. attribute:: HtmlDocument the class used to render the html, by default this is
a QTextDocument, but a QtWebKit.QWebView can be used as well.
| Nested Classes | |
|
HtmlDocument QTextDocument(QObject parent=None) QTextDocument(QString, QObject parent=None) |
|
| Instance Methods | |||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
| Properties | |
|
Inherited from |
| Method Details |
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sat Jun 12 15:41:31 2010 | http://epydoc.sourceforge.net |