✅ Purpose
Stores a block of buttons and labels that can be embedded into a template.
🧩 Fields
name— unique nameCSS— optional container CSSHTML— optional custom container HTMLbackground_image— optional image (.jpg/.jpeg/.png/.gif/.webp, max 10 MB, 5000×3000)preview— optional preview image (.jpg/.jpeg/.png, max 5 MB, 2000×2000)notes— optionalowner— FK to Usercreated_at,updated_at
🧠 Properties & methods
-
rendered_background_image- returns
url('media/<file>')ornone
- returns
-
render_html()- if
HTMLis provided: useslabel_1,button_1, etc. variables - otherwise uses
BASE_BUTTONS_CONTAINER_TEMPLATE - if
CSSis empty: generates a default style (flex column, gap, padding) - uses Jinja2 with
KeepUndefined
- if
-
copy(user=None)- clones the container with a
[copy <timestamp>]prefix - deep‑copies all Labels and Buttons
- clones the container with a
-
__str__()→ returnsname
🔗 Relations
Label.buttons_containerButton.buttons_containerLanding.buttons_container