No activity today, make something!
tiddlyweb Creating Entities In the Store

20160313160656 cdent  

The following snippet shows an example of how to create entities in a text store in a directory named data.

from tiddlyweb.model.tiddler import Tiddler
from tiddlyweb.model.bag import Bag
from import Store

environ = {}
store = Store("text", {"store_root": "data"}, environ)

bag = Bag("Foo")
bag.desc = "lorem ipsum" = ['ANY']
bag.policy.write = ['R:ADMIN']

tiddler = Tiddler("Bar", bag="Foo")
tiddler.modifier = "FND"
tiddler.text = "dolor sit amet"

N.B.: Store creation can be simplified via the get_store function in tiddlywebplugins.utils.