32 lines
707 B
Python
32 lines
707 B
Python
from data import Registry, RowModel, Table
|
|
from data.columns import Bool, Integer, Timestamp, String
|
|
|
|
from weakref import WeakValueDictionary
|
|
|
|
class Koan(RowModel):
|
|
_tablename_ = 'koans'
|
|
_cache_ = WeakValueDictionary()
|
|
|
|
koanid = Integer(primary=True)
|
|
communityid = Integer()
|
|
content = String()
|
|
deleted_at = Timestamp()
|
|
created_by = Integer()
|
|
created_at = Timestamp()
|
|
_timestamp = Timestamp()
|
|
|
|
|
|
class KoanInfo(Koan):
|
|
_tablename_ = 'koans_info'
|
|
_readonly_ = True
|
|
_cache_ = WeakValueDictionary()
|
|
|
|
koanlabel = Integer()
|
|
is_deleted = Bool()
|
|
|
|
|
|
class KoansData(Registry):
|
|
VERSION = ('KOANS', 2)
|
|
koans = Koan.table
|
|
koans_info = KoanInfo.table
|