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