Action

Base class: Fragment

The Action class describes buttons and links.

Examples:

# Link
Action(attrs__href='http://example.com')

# Link with icon
Action.icon('edit', attrs__href="edit/")

# Button
Action.button(attrs__value='Button title!')

# A submit button
Action.submit(display_name='Do this')

# The primary submit button on a form, unnecessary
# most of the time as a form includes a submit
# button by default.
Action.primary()

# A button styled as primary but not using
# the submit html element, but the button
# element.
Action.primary(call_target__attribute='button')

Refinable members

  • after
    Type: Union[int, str]
  • assets
    Type: Namespace
  • attrs
    Type: Attrs
  • display_name
    Type: str
  • endpoints
    Type: Namespace
  • extra
    Type: Dict[str, Any]
  • extra_evaluated
    Type: Dict[str, Any]
  • group
    Type: str
  • include
    Type: bool
  • iommi_style
    Type: str
  • post_handler
    Type: Callable
  • tag
  • template
    Type: Union[str, iommi._web_compat.Template]

Defaults

  • display_name
    • lambda action, **_: capitalize(action._name).replace('_', ' ')
  • tag
    • a

Shortcuts

button

Defaults

  • tag
    • button

delete

Defaults

  • call_target__attribute
    • submit

icon

Defaults

  • icon_classes
    • []

primary

Defaults

  • call_target__attribute
    • submit

submit

Defaults

  • call_target__attribute
    • button
  • tag
    • input
  • attrs__type
    • submit
  • attrs__accesskey
    • s
  • attrs__name
    • lambda action, **_: action.own_target_marker()
  • display_name
    • Submit