def _check_file(): storage_tm.begin() try: store = get_storage_store() content_blob = store.get(model.ContentBlob, hash_value) if not content_blob: raise ValueError("content blob is not there") finally: storage_tm.abort()
def _find_users(self): """Perform storm query based on current filter.""" store = get_storage_store() conditions = [] if self.filter is not None: filter = unicode("%" + self.filter + "%") conditions.append( model.StorageUser.username.like(filter, case_sensitive=False)) return store.find(model.StorageUser, *conditions).order_by(model.StorageUser.username)