On Wednesday 19 November 2008 08:48:34 am Ed Leafe wrote:
> On Nov 19, 2008, at 10:41 AM, johnf wrote:
> > Learn something new everyday.  Would you explain how the compound
> > key works
> > for the benefit of others (maybe I'm the only one that does not know).
> > Where/how does the PK get updated on a new()?  Can the compound PK
> > be of any
> > data types?  So if I wanted Invoice# and Location as my PK and
> > Invoice# = int
> > and Location = str can I mix the two?
>
>       Sure. Dabo uses a tuple internally. This method from dCursorMixin
> should clarify:
>
> def pkExpression(self, rec=None):
>       """Returns the PK expression for the passed record."""
>       if rec is None:
>               try:
>                       rec = self._records[self.RowNumber]
>               except IndexError:
>                       rec = {}
>       if isinstance(self.KeyField, tuple):
>               pk = tuple([rec[kk] for kk in self.KeyField])
>       else:
>               pk = rec.get(self.KeyField, None)
>       return pk
>
>
>
>
> -- Ed Leafe


Thanks



-- 
John Fabiani


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

Reply via email to