示例#1
0
    def get(self, rowid, asdict=False):
        """
            The logic to retrieve and update the row is in the DBSRow class.
            This call constructs a DBSRow class, and verifies that
            the row exists in the database.

            It returns sequence, as per the dbapi spec.

            Multiples are a problem. The multiple is returned as a nested
            sequence of sequences.
        """
        record = DBSRow(self, self.dd, rowid, fieldids=self.fieldids, internal=self.internal)
        if self.internal:
            record.raw_retrieve(self._gl_cache)
        else:
            record.retrieve()
        if asdict:
            return dict(zip(self.fieldnames(), record.as_list()))
        else:
            return record.as_list()
示例#2
0
    def get(self, rowid, asdict=False):
        """
            The logic to retrieve and update the row is in the DBSRow class.
            This call constructs a DBSRow class, and verifies that
            the row exists in the database.

            It returns sequence, as per the dbapi spec.

            Multiples are a problem. The multiple is returned as a nested
            sequence of sequences.
        """
        record = DBSRow(self,
                        self.dd,
                        rowid,
                        fieldids=self.fieldids,
                        internal=self.internal)
        if self.internal:
            record.raw_retrieve(self._gl_cache)
        else:
            record.retrieve()
        if asdict:
            return dict(zip(self.fieldnames(), record.as_list()))
        else:
            return record.as_list()