Files
leocrm/templates/plugin-template/models.py
T

39 lines
1.3 KiB
Python
Raw Normal View History

2026-07-23 19:01:18 +02:00
"""
SQLAlchemy models for the example plugin.
Uncomment and customize for your plugin's data model.
"""
# from __future__ import annotations
#
# import uuid
# from datetime import datetime
#
# from sqlalchemy import Boolean, Column, DateTime, ForeignKey, String, Text
# from sqlalchemy.dialects.postgresql import UUID
# from sqlalchemy.orm import Mapped, mapped_column, relationship
#
# from app.database import Base
#
#
# class ExampleItem(Base):
# __tablename__ = "example_items"
#
# id: Mapped[uuid.UUID] = mapped_column(
# UUID(as_uuid=True), primary_key=True, default=uuid.uuid4
# )
# tenant_id: Mapped[uuid.UUID] = mapped_column(
# UUID(as_uuid=True), ForeignKey("tenants.id"), nullable=False
# )
# name: Mapped[str] = mapped_column(String(200), nullable=False)
# description: Mapped[str | None] = mapped_column(Text, nullable=True)
# is_active: Mapped[bool] = mapped_column(Boolean, default=True)
# created_at: Mapped[datetime] = mapped_column(
# DateTime(timezone=True), default=datetime.utcnow
# )
# updated_at: Mapped[datetime] = mapped_column(
# DateTime(timezone=True), default=datetime.utcnow, onupdate=datetime.utcnow
# )
#
# tenant = relationship("Tenant", back_populates="example_items")