Ed Leafe wrote:

> I'm in the middle of training here at Rackspace, so the only Internet  
> access I have is my phone. Can you tell me when dCursorMixin.new() is  
> called, where that record gets added into the _mementos attribute?

It doesn't, because it is too early - cursor doesn't know what the pk 
value is yet. When you call biz.new() though, it calls 
cursor.setNewFlag() when appropriate, which adds it to the _newRecords 
attribute.

Only when there's an actual change to a field value will the original 
information get added to _mementos. This happens in setFieldVal().

Here's the code for dCursorMixin.setNewFlag():
         def setNewFlag(self):
                 """Set the current record to be flagged as a new record.

                 dBizobj will automatically call this method as 
appropriate, but if you are
                 using dCursor without a proxy dBizobj, you'll need to 
manually call this
                 method after cursor.new(), and (if applicable) after 
cursor.genTempAutoPK().
                 For example:
                         cursor.new()
                         cursor.genTempAutoPK()
                         cursor.setNewFlag()
                 """
                 if self.KeyField:
                         pk = self.getPK()
                         self._newRecords[pk] = None

Paul

  --
http://paulmcnett.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to