Create a list of new instances of the related model.

        :param records: instances attributes
        :type records: list

        :rtype: list
339575
def create_many(self, records):
        
        instances = []

        for record in records:
            instances.append(self.create(**record))

        return instances
959361
def new_page(record, values = [])
      idx = @page_counter
      @page_counter += 1
      mark_page_as_modified(IDListPage.new(self, record, idx, values))
      idx
    end
796649
def on_records(self, records):
        
        handler = self.handlers.get("on_records")
        if callable(handler):
            handler(records)
191577
def addRecords(self, records):
        
        label_mapper    = self.labelMapper()
        icon_mapper     = self.iconMapper()
        
        # create the items to display
        tree = None
        if self.showTreePopup():
            tree = self.treePopupWidget()
            tree.blockSignals(True)
            tree.setUpdatesEnabled(False)
        
        # add the items to the list
        start = self.count()
        self.addItems(map(label_mapper, records))
        
        # update the item information
        for i, record in enumerate(records):
            index = start + i
            
            self.setItemData(index, wrapVariant(record), Qt.UserRole)
            
            if icon_mapper:
                self.setItemIcon(index, icon_mapper(record))
            
            if tree:
                XOrbRecordItem(tree, record)
        
        if tree:
            tree.blockSignals(False)
            tree.setUpdatesEnabled(True)
1330106
def new_record(self, key, value):
    
    new_record = self.get('new_record', {})
    ids = self.get('ids', [])

    for value in force_list(value):
        for id_ in force_list(value.get('a')):
            ids.append({
                'schema': 'SPIRES',
                'value': id_,
            })

        new_recid = force_single_element(value.get('d', ''))
        if new_recid:
            new_record = get_record_ref(new_recid, 'authors')

    self['ids'] = ids
    return new_record
945708
def init_relation(self, models, relation):
        
        for model in models:
            model.set_relation(
                relation, Result(self._related.new_collection(), self, model)
            )

        return models
656519
def recordings(self):
        
        if self._recordings is None:
            self._recordings = RecordingList(self)
        return self._recordings
769020
def records(self):
        
        records = self._records
        next_record = records.popleft
        while records:
            yield next_record()
        attached = self.attached
        if attached():
            self._session.send()
        while attached():
            self._session.fetch()
            while records:
                yield next_record()
1237557
def addrecords(self, new):
        
        data = spreadsheet.addrecords(self,new)
        data = data.view(tabarray)
        data.coloring = self.coloring
        return data
433305
def create(record)
      result = self.class.post(worksheet_url,
        :body => { "fields" => record.fields }.to_json,
        :headers => { "Content-type" => "application/json" }).parsed_response

      check_and_raise_error(result)

      record.override_attributes!(result_attributes(result))
      record
    end
300389
def from_record(self, record):
        
        kwargs = self.get_field_kwargs(record)
        return self.sequenced_item_class(**kwargs)
70634
def eachRecord( records = @records )
      if records and block_given?
         records.each { |record|
            if record.is_a?( REXML::Element) and record.name == "record"
               @record = record
               yield record
            end
         }
      end
      nil
   end
1228734
def fields_for record_name, record_object = nil, fields_options = {}, &block
      super record_name, record_object, fields_options.merge(builder: self.class), &block
    end
575008
public void add(List<BatchCSVRecord> record) {
        if (records == null)
            records = new ArrayList<>();
        records.add(record);
    }
119216
def list(self, domain_id, sub_domain=None):
        '''
        '''
        optional_args = {}
        if sub_domain != None:
            optional_args['sub_domain'] = sub_domain
        r = self._api.do_post('Record.List', domain_id=domain_id,
                              **optional_args)
        record_list = []
        for record in r['records']:
            record['domain_id'] = domain_id
            record_list.append(Record(record))
        return record_list
1000443
def records(self):
        """"""
        return ModelList(*[r for sent in self.sentences for r in sent.records])
495491
def recreate_relationships(self, class_, attribute_name, key):
        '''
        
        '''
        iterable = self.record_keeper.foreign_to_many_foreign_map[key]
        for foreign_page_id, foreign_page_id_list in iteritems(iterable):

            # Assumption: local page has been indexed and exists
            # TODO: handle case where it doesn't exist
            local_page_id = self.record_keeper.get_local_page(foreign_page_id)
            local_page = Page.objects.get(id=local_page_id).specific

            for _foreign_page_id in foreign_page_id_list:
                try:
                    local_version_page_id = (self.record_keeper
                                             .get_local_page(_foreign_page_id))
                    foreign_page = Page.objects.get(
                        id=local_version_page_id).specific
                    realtionship_object = class_(page=local_page)
                    setattr(realtionship_object, attribute_name, foreign_page)
                    realtionship_object.save()
                except Exception as e:
                    context = {
                        "exception": e,
                        "function_schema": ("recreate_relationships"
                                            "(class, attribute_name, key)"),
                        "attribute_name": str(attribute_name),
                        "key": str(key),
                        "class": str(class_),
                        "foreign_page_id": str(foreign_page_id),
                    }
                    self.log(ERROR, "recreating relationships",
                             context=context)