def init_settings(self): self.settings = OOBTree.OOBTree()
def __init__(self, context=None): self._following = OOBTree.OOBTree() self._followers = OOBTree.OOBTree()
def clear(self): self._following = OOBTree.OOBTree() self._followers = OOBTree.OOBTree()
def clear(self): self._users = OOBTree.OOBTree()
def __init__(self): self._bookings = OOBTree.OOTreeSet() self._count = Length(0)
def __init__(self, context=None): # maps user id to liked content uids self._user_uuids_mapping = OOBTree.OOBTree() # maps content uid to user ids self._uuid_users_mapping = OOBTree.OOBTree()
def __init__(self, context=None): self._users = OOBTree.OOBTree()
def __init__(self, title): self.title = title self.categories = OOBTree.BTree()
def tag(self, item_type, item_id, user_id, *tags): """User <user_id> adds tags <*tags> on <item_type> <item_id>""" item_type = decode(item_type) assert (item_type in self.supported_tag_types) user_id = decode(user_id) item_id = decode(item_id) tags = [decode(tag) for tag in tags] for tag in tags: if user_id not in self._tagged: self._tagged[user_id] = OOBTree.OOBTree() if tag not in self._tagged[user_id]: self._tagged[user_id][tag] = OOBTree.OOBTree() for _type in self.supported_tag_types: self._tagged[user_id][tag][_type] = OOBTree.OOTreeSet() self._tagged[user_id][tag][item_type].insert(item_id) if item_id not in self._tagger[item_type]: self._tagger[item_type][item_id] = OOBTree.OOBTree() if tag not in self._tagger[item_type][item_id]: self._tagger[item_type][item_id][tag] = OOBTree.OOTreeSet() self._tagger[item_type][item_id][tag].insert(user_id) if user_id not in self._tags: self._tags[user_id] = OOBTree.OOBTree() for _type in self.supported_tag_types: self._tags[user_id][_type] = OOBTree.OOBTree() if item_id not in self._tags[user_id][item_type]: self._tags[user_id][item_type][item_id] = OOBTree.OOTreeSet() self._tags[user_id][item_type][item_id].insert(tag) if tag not in self._bytag: self._bytag[tag] = OOBTree.OOBTree() for _type in self.supported_tag_types: self._bytag[tag][_type] = OOBTree.OOBTree() if item_id not in self._bytag[tag][item_type]: self._bytag[tag][item_type][item_id] = OOBTree.OOTreeSet() self._bytag[tag][item_type][item_id].insert(user_id)
def init_settings(self): # userid -> userdata self._useridentities_by_userid = OOBTree.OOBTree() self.session = {}
def __init__(self): base.MPSessionManager.__init__(self, PSession, OOBTree.OOBTree())
def blank_db(root): root['users'] = _oob.OOBTree() root['admin'] = _oob.OOBTree() root['piadas'] = _iobtree.IOBTree() root['version'] = 1
def bar(root): request = make_mocked_request('POST', '/') txn = root._p_jar.transaction_manager.begin(request) SetItemView(root, request)('bar', OOBTree.OOBTree()) txn.commit() yield root['bar']
def __init__(self, id, title=None, **kw): self._setId(id) self.title = title self.settings = OOBTree.OOBTree() self.plugin_caching = True
def __init__(self): self.__files = OOBTree.OOBTree() self.__idGen = Counter()
def __init__(self, context=None): """ Set up storage for personalized data structures. FOLLOW: users can follow eachother, or content etc. --------------------------------------------------- _following["user"][userid] = (userid, userid, ...) _followers["user"][userid] = (userid, userid, ...) Other follow types can be switched on here but are not used anywhere yet. LIKE: users can like content or statusupdates --------------------------------------------- _likes["content"][userid] = (uuid, uuid, ...) _liked["content"][uuid] = (userid, userid, ...) _likes["update"][userid] = (statusid, statusid, ...) _liked["update"][statusid] = (userid, userid, ...) TAG: users can apply personal tags on anything. ----------------------------------------------- More complex than following or liking since tagging is a 3-way relation (subject, tags, object) Endorsements can be implemented as users tagging item_id users. supported_tag_types = ("user", "content", "update") Objects tagged by a user: _tagged[userid] = {tag: {type: ids}} _tagged[userid][tag] = {type: ids} _tagged[userid][tag]["user"] = (userid, userid, ...) _tagged[userid][tag]["content"] = (uuid, uuid, ...) Users that tagged an object: _tagger[item_type][id] = {tag: userids} _tagger["user"][userid][tag] = (userid, userid, ...) _tagger["content"][uuid][tag] = (userid, userid, ...) Tags applied by a user: _tags[user_id] = {item_type: item_id: (tag, tag,...)} _tags[user_id]["user"][userid] = (tag, tag, ...) _tags[user_id]["content"][uuid] = (tag, tag, ...) Find objects by tag: (and the users who applied that tag) _bytag[tag] = {item_type: {item_id: (userid, userid)} _bytag[tag]["user"][user_id] = (userid, userid, ...) _bytag[tag]["content"][uuid] = (userid, userid, ...) """ # following self._following = OOBTree.OOBTree() self._followers = OOBTree.OOBTree() for item_type in self.supported_follow_types: self._following[item_type] = OOBTree.OOBTree() self._followers[item_type] = OOBTree.OOBTree() # like self._likes = OOBTree.OOBTree() self._liked = OOBTree.OOBTree() for item_type in self.supported_like_types: self._likes[item_type] = OOBTree.OOBTree() self._liked[item_type] = OOBTree.OOBTree() # tags self._tagged = OOBTree.OOBTree() self._tagger = OOBTree.OOBTree() self._tags = OOBTree.OOBTree() self._bytag = OOBTree.OOBTree() for item_type in self.supported_tag_types: self._tagger[item_type] = OOBTree.OOBTree()
def __init__(self): self.__files = OOBTree.OOBTree()
def addSearchCache(self): self.searches = OOBTree.OOBTree()