✅ Purpose

A clickable button inside a ButtonsContainer.

🧩 Fields

  • text — button text
  • text_color — RGB color, default #000000
  • text_style — one of: bold, italic, underline, strikethrough
  • background_image — optional image (.jpg/.jpeg/.png/.gif/.webp, max 10 MB, 5000×3000)
  • background_color — color, default #FFFFFF
  • buttons_container — FK to ButtonsContainer
  • owner — FK to User
  • created_at, updated_at

🧠 Properties & methods

  • rendered_background_image

    • returns url('media/<file>') or none
  • render_html()

    • uses BASE_BUTTON_TEMPLATE
    • embeds placeholders {{ click_link_<id> }} and {{ double_link_<id> }}
    • inline styles: color, background, cursor, etc.
  • copy(user=None, buttons_container=None)

    • duplicates the button and optionally attaches to another container
  • __str__() → returns text

🔗 Relations

  • belongs to one ButtonsContainer
  • can be referenced by multiple ButtonClick records