labpack/databases/sql.py
def read(self, primary_key):
    
        ''' 
            a method to retrieve the details for a record in the table 
            
        :param primary_key: string with primary key of record 
        :return: dictionary with record fields 
        '''
        
        title = '%s.read' % self.__class__.__name__
        
    # retrieve record object
        # record_object = self.session.query(self.record).filter_by(id=primary_key).first()
        select_statement = self.table.select(self.table.c.id==primary_key)
        record_object = self.session.execute(select_statement).first()
        if not record_object:
            raise ValueError('%s(primary_key=%s) does not exist.' % (title, primary_key))
        
    # reconstruct record details
        record_details = self._reconstruct_record(record_object)
                    
        return record_details
 
            a method to retrieve the details for a record in the table 
            
        :param primary_key: string with primary key of record 
        :return: dictionary with record fields 
        
a method to retrieve the details for a record in the table
a method to retrieve the details for a record in the table
def read(self, primary_key):
        title = '%s.read' % self.__class__.__name__
        select_statement = self.table.select(self.table.c.id==primary_key)
        record_object = self.session.execute(select_statement).first()
        if not record_object:
            raise ValueError('%s(primary_key=%s) does not exist.' % (title, primary_key))
        record_details = self._reconstruct_record(record_object)
        return record_details
def read ( self , primary_key ) : title = '%s.read' % self . __class__ . __name__ select_statement = self . table . select ( self . table . c . id == primary_key ) record_object = self . session . execute ( select_statement ) . first ( ) if not record_object : raise ValueError ( '%s(primary_key=%s) does not exist.' % ( title , primary_key ) ) record_details = self . _reconstruct_record ( record_object ) return record_details
a method to retrieve the details for a record in the table
a method to retrieve the details for a record in the table
''' 
            a method to retrieve the details for a record in the table 
            
        :param primary_key: string with primary key of record 
        :return: dictionary with record fields 
        ''' # retrieve record object # record_object = self.session.query(self.record).filter_by(id=primary_key).first() # reconstruct record details
dictionary with record fields
dictionary with record fields
self
primary_key
string with primary key of record
string with primary key of record