def reload(self, cascadeObjects=True):
_id = self._id<EOL>if not _id:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>currentData = self.asDict(False, forStorage=False)<EOL>newDataObj = self.objects.get(_id)<EOL>if not newDataObj:<EOL><INDENT>raise KeyError('<STR_LIT>' %(_id,))<EOL><DEDENT>newData = newDataObj.asDict(False, forStorage=False)<EOL>if currentData == newData and not self.foreignFields:<EOL><INDENT>return []<EOL><DEDENT>updatedFields = {}<EOL>for thisField, newValue in newData.items():<EOL><INDENT>defaultValue = thisField.getDefaultValue()<EOL>currentValue = currentData.get(thisField, defaultValue)<EOL>fieldIsUpdated = False<EOL>if currentValue != newValue:<EOL><INDENT>fieldIsUpdated = True<EOL><DEDENT>elif cascadeObjects is True and issubclass(thisField.__class__, IRForeignLinkFieldBase):<EOL><INDENT>if currentValue.isFetched():<EOL><INDENT>oldObjs = currentValue.getObjs()<EOL>newObjs = newValue.getObjs()<EOL>if oldObjs != newObjs: <EOL><INDENT>fieldIsUpdated = True<EOL><DEDENT>else:<EOL><INDENT>for i in range(len(oldObjs)):<EOL><INDENT>if not oldObjs[i].hasSameValues(newObjs[i], cascadeObjects=True):<EOL><INDENT>fieldIsUpdated = True<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>if fieldIsUpdated is True:<EOL><INDENT>updatedFields[thisField] = ( currentValue, newValue) <EOL>setattr(self, thisField, newValue)<EOL>self._origData[thisField] = newDataObj._origData[thisField]<EOL><DEDENT><DEDENT>return updatedFields<EOL>
reload - Reload this object from the database, overriding any local changes and merging in any updates.


    @param cascadeObjects <bool> Default True. If True, foreign-linked objects will be reloaded if their values have changed
      since last save/fetch. If False, only if the pk changed will the foreign linked objects be reloaded.

    @raises KeyError - if this object has not been saved (no primary key)

    @return - Dict with the keys that were updated. Key is field name that was updated,
       and value is tuple of (old value, new value). 

    NOTE: Currently, this will cause a fetch of all Foreign Link objects, one level