Quotes data and cog skeleton.
This commit is contained in:
28
quotes/data.py
Normal file
28
quotes/data.py
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
Reference in New Issue
Block a user