Anton Shestakov <engored@ya.ru>, Thu, 21 Mar 2013 16:04:47 +0900
Update Underscore (1.4.3), Backbone (1.0.0) and Shard.
fruitbar/indexes.py
Permissions: -rw-r--r--
from CodernityDB.hash_index import HashIndex class ProjectIndex(HashIndex): def __init__(self, *args, **kwargs): kwargs['key_format'] = '16s' super(ProjectIndex, self).__init__(*args, **kwargs) def make_key_value(self, data): if data['_t'] == 'project': return md5(data['workspace'].encode('utf-8')).digest(), None class TaskIndex(HashIndex): def __init__(self, *args, **kwargs): kwargs['key_format'] = '16s' super(TaskIndex, self).__init__(*args, **kwargs) def make_key_value(self, data): return md5(data['workspace'].encode('utf-8')).digest(), None def run_delete_for_project(self, db, workspace, project_id): for task in db.get_many('task', workspace, with_doc=True): if task['doc']['project_id'] == project_id: