Record: 获取当前栏目的所有父栏目
507367
public function getParents()
    {
        $parents = $this()->beColl();

        $category = $this;
        while ($parent = $category->getParent()->find()) {
            $parents[] = $category = $parent;
        }

        return $parents;
    }
540049
def sort_records(records)
      sort_order = order.map { |direction| [ direction.target, direction.operator == :asc ] }

      records.sort_by do |record|
        sort_order.map do |(property, ascending)|
          Sort.new(record_value(record, property), ascending)
        end
      end
    end
1240889
def records(self):
        
        import ns1.rest.records
        return ns1.rest.records.Records(self.config)
1030733
def record(self):
        """"""
        if self.recordmetadata:
            return Record(self.recordmetadata.json, model=self.recordmetadata)
        else:
            return None
1208615
def _walk_all_files():
    
    # Init records
    record_dirs = set()
    result_set = set()

    for filename in Settings.paths:
        # Record dirs to put timestamps in later
        filename_full = os.path.abspath(filename)
        if Settings.recurse and os.path.isdir(filename_full):
            record_dirs.add(filename_full)

        walk_after = timestamp.get_walk_after(filename_full)
        results = walk_file(filename_full, walk_after, Settings.recurse)
        result_set = result_set.union(results)

    bytes_in = 0
    bytes_out = 0
    nag_about_gifs = False
    errors = []
    for result in result_set:
        res = result.get()
        if res.error:
            errors += [(res.final_filename, res.error)]
            continue
        bytes_in += res.bytes_in
        bytes_out += res.bytes_out
        nag_about_gifs = nag_about_gifs or res.nag_about_gifs

    return record_dirs, bytes_in, bytes_out, nag_about_gifs, errors
1099735
def get_next_record(in_uid, kind='1'):
        '''
        
        '''
        current_rec = MPost.get_by_uid(in_uid)
        recs = TabPost.select().where(
            (TabPost.kind == kind) &
            (TabPost.time_create < current_rec.time_create)
        ).order_by(TabPost.time_create.desc())
        if recs.count():
            return recs.get()
        return None
505960
def listdir(self, folder_id='0', offset=None, limit=None, fields=None):
		''
		if fields is not None\
			and not isinstance(fields, types.StringTypes): fields = ','.join(fields)
		return self(
			join('folders', folder_id, 'items'),
			dict(offset=offset, limit=limit, fields=fields) )
740570
def records( self ):
        
        records = []
        for i in range(self.count()):
            record = self.recordAt(i)
            if record:
                records.append(record)
        return records
892425
def list_records_previous_page(self):
        
        uri = self._paging.get("record", {}).get("prev_uri")
        if uri is None:
            raise exc.NoMoreResults("There are no previous pages of records "
                    "to list.")
        return self._list_records(uri)
81099
def selectedRecords(self):
        
        output = []
        for item in self.selectedItems():
            if ( isinstance(item, XOrbRecordItem) ):
                output.append(item.record())
        return output
72902
def __search_record(self, task_group_id):
		
		for i in range(len(self.__records)):
			record = self.__records[i]
			if record.task_group_id() == task_group_id:
				yield record, i
717174
def next(self):
        
        if self._current < len(self._record_list):
            rec = self._record_list[self._current]
            key = rec['name']
            self._current += 1
            return key
        else:
            raise StopIteration
247016
def delete(self, record_key):

        ''' 
        '''

        title = '%s.delete' % self.__class__.__name__
        key_arg = '%s(record_key="%s")' % (title, record_key)

    # validate inputs
        record_key = self.fields.validate(record_key, '.record_key')

    # construct path to file
        file_path = os.path.join(self.collection_folder, record_key)

    # validate existence of file
        if not os.path.exists(file_path):
            exit_msg = '%s does not exist.' % record_key
            return exit_msg
    
    # delete file asynchronously
    #     if non_blocking:
    #         self._delete(file_path, title, record_key)
    #         exit_msg = '%s will be deleted.' % record_key
    #         return exit_msg
        
    # remove file
        current_dir = os.path.split(file_path)[0]
        try:
            os.remove(file_path)
        except:
            raise Exception('%s failed to delete %s' % (key_arg, record_key))

    # # remove empty directories in path to file
    #     if not os.listdir(current_dir):
    #         os.removedirs(current_dir)

    # remove empty directories in path to file
        while current_dir != self.collection_folder:
            if not os.listdir(current_dir):
                os.rmdir(current_dir)
                current_dir = os.path.split(current_dir)[0]
            else:
                break

        exit_msg = '%s has been deleted.' % record_key
        return exit_msg
1038835
def records(options={})
      options["sortField"], options["sortDirection"] = options.delete(:sort) if options[:sort]
      results = self.class.get(worksheet_url, query: options).parsed_response
      check_and_raise_error(results)
      RecordSet.new(results)
    end
735749
def filter_record(self, record):
        
        nloc = record.seq.find('N')
        if nloc == -1:
            return record
        elif self.action == 'truncate':
            return record[:nloc]
        elif self.action == 'drop':
            raise FailedFilter()
        else:
            assert False
1319528
def filter(self, record: logging.LogRecord):
        
        update = types.Update.get_current(True)
        if update:
            for key, value in self.make_prefix(self.prefix, self.process_update(update)):
                setattr(record, key, value)

        return True
1314886
def record(index)
      seek_to_record(index)
      return nil if deleted_record?

      DBF::Record.new(@data.read(record_length), columns, version, @memo)
    end