Return a record to be used for database storage. This only makes sense if self.id is set. See usage example
           above.
352499
def get_pdb_sets(self):
        ''''''

        assert(self.id != None)

        data = []
        for pdb_set in self.pdb_sets:

            pdb_set_record = dict(
                PPComplexID = self.id,
                SetNumber = pdb_set['set_number'],
                IsComplex = pdb_set['is_complex'],
                Notes = pdb_set['notes'],
            )

            chain_records = []
            for side, chain_details in sorted(pdb_set['chains'].iteritems()):
                chain_records.append(dict(
                    PPComplexID = self.id,
                    SetNumber = pdb_set['set_number'],
                    Side = side,
                    ChainIndex = chain_details['chain_index'],
                    PDBFileID = chain_details['pdb_file_id'],
                    Chain = chain_details['chain_id'],
                    NMRModel = chain_details['nmr_model'],
                ))

            data.append(dict(pdb_set = pdb_set_record, chain_records = chain_records))

        return data
933907
def get(self, id):
        
        for obj in self.model.db:
            if obj["id"] == id:
                return self._cast_model(obj)

        return None
569528
protected int selectRecordId(String hash) throws SQLException {
        int id = -1;
        Connection connection = getConnection();
        try {
            PreparedStatement ps = setObjects(connection, Query.GET_RECORD_ID,
                    hash);
            ResultSet rs = ps.executeQuery();
            try {
                while (rs.next()) {
                    id = rs.getInt("id");
                    break;
                }
            } finally {
                rs.close();
                ps.close();
            }
        } finally {
            connection.close();
        }
        return id;
    }
651952
def setRecord(self, record):
        
        self._record = record
        if record is not None:
            self.loadValues(record.recordValues(autoInflate=True))
        else:
            self.loadValues({})
779434
def db(self):
        

        # Initialize the database handle; we're running in a separate
        # process, so we need to get_database() ourself
        if not self._db:
            self._db = self.config.get_database()

        return self._db
845020
def __store_record(self, record):
		
		if isinstance(record, WSimpleTrackerStorage.Record) is False:
			raise TypeError('Invalid record type was')
		limit = self.record_limit()
		if limit is not None and len(self.__registry) >= limit:
			self.__registry.pop(0)
		self.__registry.append(record)
189084
def records2ids(iterable):
    
    def record2id(elt):
        """If `elt` is a record, return its ID."""
        if isinstance(elt, Model):
            return elt.id
        return elt
    return [record2id(elt) for elt in iterable]
375363
def class_and_id(record_or_hash)
      if record_or_hash.is_a?(Hash)
        [record_or_hash[:class], record_or_hash[:id]]
      else
        [record_or_hash.class, Sunspot::Adapters::InstanceAdapter.adapt(record_or_hash).id]
      end
    end
672766
def set_record(self, name, record_id, record):
        
        if name not in self._cache:
            self._cache[name] = {}
        self._cache[name][record_id] = record
477222
public Record openMainRecord()
    {
        Record record = null;
        if (this.getProperty(DBParams.APPLET) != null)
        	return null;	// Ignore params if I want the applet html displayed
        String strParamRecord = this.getProperty(DBParams.RECORD);      // Display record
        if ((strParamRecord != null) && (strParamRecord.length() > 0))
            record = Record.makeRecordFromClassName(strParamRecord, this);
        return record;
    }
1205644
def get_record(identifier)
      doc = client.get!(CGI.escape(identifier)).body.to_json
      @record_class.build(mint_id(identifier), doc, 'application/json')
    end
25852
def get(id)
      return unless id
      with_redis { |redis| redis.get(redis_key_for(id)).try { |data| load(data) } }
    end
719365
def _guess_record(self, rtype, name=None, content=None):
        """"""
        records = self._list_records_internal(
            identifier=None, rtype=rtype, name=name, content=content)
        if len(records) == 1:
            return records[0]
        if len(records) > 1:
            raise Exception(
                'Identifier was not provided and several existing '
                'records match the request for {0}/{1}'.format(rtype, name))
        raise Exception(
            'Identifier was not provided and no existing records match '
            'the request for {0}/{1}'.format(rtype, name))
1293469
def find(id)
      result = self.class.get(worksheet_url + "/" + id).parsed_response
      check_and_raise_error(result)
      Record.new(result_attributes(result)) if result.present? && result["id"]
    end
1364004
def get(self, id):
        
        with rconnect() as conn:
            if id is None:
                raise ValueError

            if isinstance(id, uuid.UUID):
                id = str(id)

            if type(id) != str and type(id) != unicode:
                raise ValueError

            try:
                query = self._base().get(id)
                log.debug(query)
                rv = query.run(conn)
            except ReqlOpFailedError as e:
                log.warn(e)
                raise
            except Exception as e:
                log.warn(e)
                raise
            if rv is not None:
                return self._model(rv)

            return None
1261016
def post(self):
        

        resource_data = self.request.json

        record = {'id': str(len(resource_db) + 1),
                  'name': resource_data.get('name')}

        resource_db.append(record)

        return self.response_factory.ok(data=record)
823392
def store(self, record, value):
        """"""
        if record._values[self.name].get(record.id):
            tuples2ids(value, record._values[self.name][record.id])
        else:
            record._values[self.name][record.id] = tuples2ids(value, [])