Changeset 684


Ignore:
Timestamp:
Jan 2, 2016, 8:10:47 AM (4 years ago)
Author:
cito
Message:

Some fixes in the documentation

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.x/docs/pgdb.rst

    r679 r684  
    192192------------------------------------
    193193
    194 .. method:: pgdbCnx.cusor()
     194.. method:: pgdbCnx.cursor()
    195195
    196196    Return a new cursor object using the connection
     
    226226.. attribute:: pgdbCursor.description
    227227
    228     This read-only attribute is a sequence of 7-item sequences.
    229 
    230     Each of these sequences contains information describing one result column:
     228    This read-only attribute is a sequence of 7-item tuples.
     229
     230    Each of these tuples contains information describing one result column:
    231231
    232232    - *name*
     
    238238    - *null_ok*
    239239
    240     Note that *precision*, *scale* and *null_ok* are not implemented.
     240    Note that *display_size*, *precision*, *scale* and *null_ok*
     241    are not implemented.
    241242
    242243    This attribute will be ``None`` for operations that do not return rows
     
    318319
    319320    :returns: the next row of the query result set
    320     :rtype: tuple or None
    321 
    322 Fetch the next row of a query result set, returning a single tuple,
     321    :rtype: list or None
     322
     323Fetch the next row of a query result set, returning a single list,
    323324or ``None`` when no more data is available.
    324325
     
    339340    :tpye keep: bool
    340341    :returns: the next set of rows of the query result
    341     :rtype: list of tuples
    342 
    343 Fetch the next set of rows of a query result, returning a list of tuples.
     342    :rtype: list of lists
     343
     344Fetch the next set of rows of a query result, returning a list of lists.
    344345An empty sequence is returned when no more rows are available.
    345346
     
    370371
    371372    :returns: the set of all rows of the query result
    372     :rtype: list of tuples
    373 
    374 Fetch all (remaining) rows of a query result, returning them as list of tuples.
     373    :rtype: list of list
     374
     375Fetch all (remaining) rows of a query result, returning them as list of lists.
    375376Note that the cursor's :attr:`arraysize` attribute can affect the performance
    376377of this operation.
     
    383384    Process rows before they are returned
    384385
    385     :param tuple row: the currently processed row of the result set
     386    :param list row: the currently processed row of the result set
    386387    :returns: the transformed row that the cursor methods shall return
    387388
    388 Note that this method is not part of the DB-API 2 standard.
     389.. note::
     390
     391    This method is not part of the DB-API 2 standard.
    389392
    390393You can overwrite this method with a custom row factory, e.g.
    391 if you want to return rows as dicts instead of tuples::
     394if you want to return rows as dicts instead of lists::
    392395
    393396    class DictCursor(pgdb.pgdbCursor):
    394397
    395398        def row_factory(self, row):
    396             return {desc[0]:value
    397                 for desc, value in zip(self.description, row)}
     399            return dict((d[0], v) for d, v in zip(self.description, row))
    398400
    399401    cur = DictCursor(con)
     
    472474    Used to describe the ``oid`` column of PostgreSQL database tables
    473475
    474 The following more specific types are not part of the DB-API 2 standard:
     476.. note:
     477
     478    The following more specific types are not part of the DB-API 2 standard.
    475479
    476480.. class:: BOOL
  • trunk/docs/pgdb.rst

    r683 r684  
    421421    Process rows before they are returned
    422422
    423     :param tuple row: the currently processed row of the result set
     423    :param list row: the currently processed row of the result set
    424424    :returns: the transformed row that the fetch methods shall return
    425425
Note: See TracChangeset for help on using the changeset viewer.