Changeset 3679

Show
Ignore:
Timestamp:
05/06/08 12:13:02 (7 months ago)
Author:
pobrien
Message:

Fixed problem with related extents not sorting properly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Gtk/schevogtk2/relatedgrid.py

    r3306 r3679  
    2626        self.field_label = label(extent.field_spec.field_map()[field_name]) 
    2727 
     28    def __cmp__(self, other): 
     29        if other.__class__ is self.__class__: 
     30            return cmp((self.plural, self.field_label), 
     31                       (other.plural, other.field_label)) 
     32        else: 
     33            return cmp(hash(self), hash(other)) 
     34 
    2835    def __len__(self): 
    2936        return self.entity.sys.count(self.extent.name, self.field_name) 
     37 
     38    def __repr__(self): 
     39        return '%s %s %s' % (self.entity, self.extent, self.field_name) 
    3040 
    3141