Changeset 679 for branches/4.x


Ignore:
Timestamp:
Dec 30, 2015, 4:31:47 PM (4 years ago)
Author:
cito
Message:

Use simpler and more standard type names in pgdb

We already renamed the types provided by the classic module to be more simple
and intuitive. We now do the same for the types provided by the DB-API 2 module.

Location:
branches/4.x
Files:
4 edited

Legend:

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

    r674 r679  
    5757- New method use_regtypes() that can be called to let getattnames()
    5858  return regular type names instead of the simplified classic types (#44).
    59 
    6059
    6160Version 4.0 (2009-01-01)
     
    106105  and returns whether the row existed or not.
    107106
    108 
    109107Version 3.8.1 (2006-06-05)
    110108--------------------------
  • branches/4.x/docs/pg.rst

    r676 r679  
    1010Introduction
    1111============
     12
    1213You may either choose to use the "classic" PyGreSQL interface
    1314provided by the :mod:`pg` module or else the
  • branches/4.x/docs/pgdb.rst

    r677 r679  
    1010Introduction
    1111============
     12
    1213You may either choose to use the "classic" PyGreSQL interface
    1314provided by the :mod:`pg` module or else the
  • branches/4.x/module/pgdb.py

    r653 r679  
    102102# shortcut methods are not supported by default
    103103# since they have been excluded from DB API 2
    104 # and are not recommended by the DB SIG;
     104# and are not recommended by the DB SIG.
    105105
    106106shortcutmethods = 0
     
    291291        e.g. a dict factory:
    292292
    293         class myCursor(pgdb.pgdbCursor):
    294             def cursor.row_factory(self, row):
    295                 d = {}
    296                 for idx, col in enumerate(self.description):
    297                     d[col[0]] = row[idx]
    298                 return d
     293            class myCursor(pgdb.pgdbCursor):
     294
     295                def row_factory(self, row):
     296                    d = {}
     297                    for idx, col in enumerate(self.description):
     298                        d[col[0]] = row[idx]
     299                    return d
     300
    299301        cursor = myCursor(cnx)
    300302
Note: See TracChangeset for help on using the changeset viewer.