[Zope] Python script sort by id

Maarten Slaets maarten.slaets@neolabs.be
Sun, 29 Jul 2001 20:29:35 +0200


Tim Hicks wrote:
> def sort_id(ob1, ob2):
>    return cmp(ob1.getID(), ob2.getID())
> 
> It seems that the cmp function needs to get hold of attributes, not methods.
> Even if I specifically call a method on ob1 or ob2, getattr seems to be
> called in there somewhere.
> 
> Any more clues?

try getId() instead of getID()

Maarten.