Changeset 2994

Show
Ignore:
Timestamp:
03/28/07 00:07:53 (2 years ago)
Author:
paul
Message:

Added moveToPK() method in dBizobj, which does what it says. Also added
dException.RowNotFoundException?, which moveToPK() will raise when
appropriate.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/biz/dBizobj.py

    r2940 r2994  
    881881                child.setCurrentParent(pk) 
    882882 
     883    def moveToPK(self, pk): 
     884        """Move to the row with the specified pk value, or raise RowNotFoundException.""" 
     885        row = self.seek(pk, self.KeyField, caseSensitive=True, runRequery=True) 
     886        if row == -1: 
     887            raise dabo.dException.RowNotFoundException, "PK Value %s not found in the dataset" % pk 
    883888 
    884889    def seek(self, val, fld=None, caseSensitive=False, 
  • trunk/dabo/dException.py

    r2921 r2994  
    2222    pass 
    2323     
     24class RowNotFoundException(dException): 
     25    pass 
    2426 
    2527class FeatureNotImplementedException(dException):