Module: web | qm/web.py | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Common code for implementing web user interfaces.
|
handle_login
|
| handle_login ( request, default_redirect_url="/" ) Handle a login request. Authenticate the login using the user name and password stored in
the If authentication succeeds, redirect to the URL stored in the
If
|
handle_logout
|
| handle_logout ( request, default_redirect_url="/" ) Handle a logout request.
After ending the session, redirect to the URL specified by the
|
http_return_exception
|
| http_return_exception ( exc_info=None, stream=sys.stdout ) Generate an HTTP response for an exception.
|
http_return_html
|
| http_return_html ( html_text, stream=sys.stdout ) Generate an HTTP response consisting of HTML text.
|
javascript_escape
|
| javascript_escape ( text ) Equivalent to the JavaScript
|
javascript_unescape
|
| javascript_unescape ( text ) Equivalent to the JavaScript
|
make_button_for_popup
|
| make_button_for_popup ( label, url, window_width=480, window_height=240, ) Construct a button for displaying a popup page.
|
make_button_for_request
|
| make_button_for_request ( title, request, css_class=None, ) Generate HTML for a button.Note that the caller is responsible for making sure the resulting button is placed within a form element.
|
make_button_for_url
|
| make_button_for_url ( title, url, css_class=None, ) Generate HTML for a button.Note that the caller is responsible for making sure the resulting button is placed within a form element.
|
make_choose_control
|
| make_choose_control ( field_name, included_label, included_items, excluded_label, excluded_items, item_to_text=str, item_to_value=str, ordered=0, ) Construct HTML controls for selecting a subset.The user is presented with two list boxes next to each other. The box on the left lists items included in the subset. The box on the right lists items excluded from the subset but available for inclusion. Between the boxes are buttons for adding and removing items from the subset. If
|
make_help_link
|
| make_help_link ( help_text_tag, label="Help", **substitutions, ) Make a link to pop up help text.
|
make_help_link_html
|
| make_help_link_html ( help_text, label="Help" ) Make a link to pop up help text.
|
make_javascript_string
|
| make_javascript_string ( text ) Return
|
make_popup_page
|
| make_popup_page ( message, buttons, title="", ) Generate a popup dialog box page. See
|
make_properties_control
|
| make_properties_control ( form_name, field_name, properties, select_name=None, ) Construct a control for representing a set of properties.
|
make_set_control
|
| make_set_control ( form_name, field_name, add_page, select_name=None, initial_elements=[], request=None, rows=6, width=200, window_width=480, window_height=240, ordered=0, ) Construct a control for representing a set of items.
|
make_submit_button
|
| make_submit_button ( title="OK" ) Generate HTML for a button to submit the current form.
|
make_url
|
| make_url ( script_name, base_request=None, **fields, ) Create a request and return a URL for it.
|
parse_url_query
|
| parse_url_query ( url ) Parse a URL-encoded query. This function parses query strings encoded in URLs, such as
|
unescape
|
| unescape ( text ) Undo
Classes
|
|
|
|