{% extends "base.html" %} {% load components %} {% block title %}Model Demo - Component Framework{% endblock %} {% block content %}

Model-Bound Components

These components are bound to Django models with automatic database updates.

Features:

{% for order in orders %}
{% live_component "order_editor" pk=order.pk %}
{% empty %}

No orders found. Sample data will be created automatically.

{% endfor %}

How it works:

  1. Component loads Order model instance by PK
  2. State is populated from model fields
  3. UI changes trigger events
  4. Events update model and save to database
  5. Component re-renders with fresh data
{% endblock %}