rDrama/files/classes/domains.py

22 lines
574 B
Python

import time
from typing import Optional
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy.sql.sqltypes import *
from files.classes import Base
from files.helpers.types import str_pk
class BannedDomain(Base):
__tablename__ = "banneddomains"
domain: Mapped[str_pk]
reason: Mapped[str]
created_utc: Mapped[Optional[int]]
def __init__(self, *args, **kwargs):
if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time())
super().__init__(*args, **kwargs)
def __repr__(self):
return f"<{self.__class__.__name__}(domain={self.domain})>"