Telezab/app/models/auditlog.py
UdoChudo 52e31864b3 feat: Develop web interface
- Implemented the initial version of the web interface.
refactor: Begin Telegram bot refactoring
- Started restructuring the bot’s code for better maintainability.
chore: Migrate to Flask project structure
- Reorganized the application to follow Flask's project structure.
cleanup: Extensive code cleanup
- Removed redundant code and improved readability.

Signed-off-by: UdoChudo <stream@udochudo.ru>
2025-06-10 14:39:11 +05:00

19 lines
878 B
Python

from datetime import datetime
from sqlalchemy import Integer, String, DateTime
from sqlalchemy.orm import Mapped, mapped_column
from app.extensions.db import db
class AuditLog(db.Model):
__tablename__ = 'auditlog'
id: Mapped[int] = mapped_column(Integer, primary_key=True)
ldap_user_id: Mapped[str] = mapped_column(String(255), nullable=False)
username: Mapped[str | None] = mapped_column(String(255))
action: Mapped[str] = mapped_column(String(255), nullable=False)
details: Mapped[str | None] = mapped_column(String(1024))
timestamp: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
ipaddress: Mapped[str] = mapped_column(String(255), nullable=False)
def __repr__(self):
return f"<AuditLog(ldap_user_id='{self.ldap_user_id}', username='{self.username}', action='{self.action}', timestamp='{self.timestamp}')>"