from django.db import models


class ComponentSession(models.Model):
    """A model for storing component parameters.
    All queries must be routed through `django_idom.config.IDOM_DATABASE`.
    """

    uuid = models.UUIDField(primary_key=True, editable=False, unique=True)  # type: ignore
    params = models.BinaryField(editable=False)  # type: ignore
    last_accessed = models.DateTimeField(auto_now_add=True)  # type: ignore
