Changeset 273 for trunk/module/pg.py


Ignore:
Timestamp:
Mar 7, 2006, 4:50:46 PM (14 years ago)
Author:
darcy
Message:

Add code for backwards compatibilty in OID munging to avoid flag days.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/pg.py

    r271 r273  
    66# Improved by Christoph Zwerschke
    77#
    8 # $Id: pg.py,v 1.39 2006-03-04 01:28:34 darcy Exp $
     8# $Id: pg.py,v 1.40 2006-03-07 21:50:46 darcy Exp $
    99#
    1010
     
    421421                qcl = _join_parts(self._split_schema(cl)) # build qualified name
    422422                foid = 'oid(%s)' % qcl # build mangled oid
     423
     424                # XXX this code is for backwards compatibility and will be
     425                # XXX removed eventually
     426                ofoid = 'oid_' + self._split_schema(cl)[-1]
     427                if not a.has_key(foid) and a.has_key(ofoid):
     428                        a[foid] = a[ofoid]
     429
    423430                if a.has_key(foid):
    424431                        where = "oid=%s" % a[foid]
     
    452459                This method clears all the attributes to values determined by the types.
    453460                Numeric types are set to 0, Booleans are set to 'f', and everything
    454         else is set to the empty string.  If the array argument is present,
    455         it is used as the array and any entries matching attribute names are
    456         cleared with everything else left unchanged.
     461                else is set to the empty string.  If the array argument is present,
     462                it is used as the array and any entries matching attribute names are
     463                cleared with everything else left unchanged.
    457464
    458465                """
     
    484491                qcl = _join_parts(self._split_schema(cl)) # build qualified name
    485492                foid = 'oid(%s)' % qcl # build mangled oid
     493
     494                # XXX this code is for backwards compatibility and will be
     495                # XXX removed eventually
     496                ofoid = 'oid_' + self._split_schema(cl)[-1]
     497                if not a.has_key(foid) and a.has_key(ofoid):
     498                        a[foid] = a[ofoid]
     499
    486500                q = 'DELETE FROM %s WHERE oid=%s' % (qcl, a[foid])
    487501                self._do_debug(q)
Note: See TracChangeset for help on using the changeset viewer.