Files
mrtuxie-quotes-module/quotes/data.py
2025-08-28 15:42:53 +10:00

31 lines
692 B
Python

from data import Registry, RowModel, Table
from data.columns import Bool, Integer, Timestamp, String
from weakref import WeakValueDictionary
class Quote(RowModel):
_tablename_ = 'quotes'
_cache_ = WeakValueDictionary()
quoteid = Integer(primary=True)
communityid = Integer()
content = String()
deleted_at = Timestamp()
created_by = Integer()
created_at = Timestamp()
_timestamp = Timestamp()
class QuoteInfo(Quote):
_tablename_ = 'quotes_info'
_readonly_ = True
_cache_ = WeakValueDictionary()
quotelabel = Integer()
is_deleted = Bool()
class QuotesData(Registry):
quotes = Quote.table
quotes_info = QuoteInfo.table