31 lines
692 B
Python
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
|