Changeset 1d57031 in indico


Ignore:
Timestamp:
03/16/11 17:25:07 (2 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
9364f6
Parents:
bb29fc
Message:

[FIX] OOTreeSet sorting

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bin/migration/migrate_0.97_0.98.py

    re9ba8c r1d57031  
    231231        categ.conferences = OOTreeSet(categ.conferences.values()) 
    232232        if len(categ.conferences) != len(categ.conferencesBackup): 
    233             print categ.getId() 
     233            print "Problem migrating conf dict to tree set: %s" % categ.getId() 
    234234 
    235235 
  • indico/MaKaC/conference.py

    r078f40 r1d57031  
    11301130            sortType=3--> Alphabetically - Reversed 
    11311131        """ 
    1132         res = sorted(self.conferences) 
     1132        res = sorted(self.conferences, cmp=Conference._cmpByDate) 
    11331133        if sortType==2: 
    11341134            res.sort(Conference._cmpTitle) 
     
    20682068        return "<Conference %s@%s>" % (self.getId(), hex(id(self))) 
    20692069 
    2070     def __cmp__(self, toCmp): 
     2070    @staticmethod 
     2071    def _cmpByDate(self, toCmp): 
    20712072        if not isinstance(toCmp, Conference): 
    20722073            return cmp(hash(self), hash(toCmp)) 
     
    20752076            return res 
    20762077        else: 
    2077             return cmp(self.getId(), toCmp.getId()) 
     2078            return cmp(self, toCmp) 
     2079 
     2080    def __cmp__(self, toCmp): 
     2081        if not isinstance(toCmp, Conference): 
     2082            return cmp(hash(self), hash(toCmp)) 
     2083        return cmp(self.getId(), toCmp.getId()) 
    20782084 
    20792085    def __eq__(self, toCmp): 
Note: See TracChangeset for help on using the changeset viewer.