Changeset 3155

Show
Ignore:
Timestamp:
06/05/07 13:00:59 (2 years ago)
Author:
ed
Message:

Added the value of GetId?() to the repr() for dObject. I frequently need to distinguish between several objects of the same BaseClass?, and this helps to identify them both in a readable way and an unambiguous way.

Files:

Legend:

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

    r3054 r3155  
    9494            # No name; use module.classname 
    9595            nm = "%s.%s" % (self.__class__.__module__, self.__class__.__name__) 
    96         return "<%(nm)s (baseclass %(classname)s)>" % locals() 
     96        try: 
     97            _id = self.GetId() 
     98        except: 
     99            _id = "?" 
     100        return "<%(nm)s (baseclass %(classname)s, id:%(_id)s)>" % locals() 
    97101         
    98102