Changeset 5915


Ignore:
Timestamp:
6 Apr 2011, 06:44:36 (14 years ago)
Author:
Henrik Bettermann
Message:

Use only getName method from helpers.py. Don't define getName for each container class.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/tables.py

    r5006 r5915  
    66from waeup.sirp.widgets.table import YUITable as Table
    77from waeup.sirp.widgets.table import Col
     8from waeup.sirp.utils.helpers import getName
    89
    910class CodeAndTitleTableProvider(grok.Adapter):
     
    4142            Col(
    4243                header='Title', sortable=True,
    43                 data = tuple([data.getName(x) for x in data])),
     44                data = tuple([getName(data[x]) for x in data])),
    4445            )
    4546        self.table = Table(self.title, cols=cols)
  • main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.py

    r5005 r5915  
    3535            del self[key]
    3636
    37     def getName(self, key):
    38         """Get complete faculty name.
    39         """
    40         if key in self.keys():
    41             dept = self[key]
    42             prefix = dept.title_prefix
    43             prefix = prefix[0].upper() + prefix[1:]
    44             return '%s of %s' % (prefix, dept.title)
     37    #def getName(self, key):
     38    #    """Get complete department name.
     39    #    """
     40    #    if key in self.keys():
     41    #        dept = self[key]
     42    #        prefix = dept.title_prefix
     43    #        prefix = prefix[0].upper() + prefix[1:]
     44    #        return '%s of %s' % (prefix, dept.title)
    4545
    4646       
  • main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.py

    r5070 r5915  
    2222            del self[key]
    2323
    24     def getName(self, key):
    25         if key in self.keys():
    26             fac = self[key]
    27             prefix = fac.title_prefix
    28             prefix = prefix[0].upper() + prefix[1:]
    29             return '%s of %s' % (prefix, fac.title)
     24    #def getName(self, key):
     25    #    if key in self.keys():
     26    #        fac = self[key]
     27    #        prefix = fac.title_prefix
     28    #        prefix = prefix[0].upper() + prefix[1:]
     29    #        return '%s of %s' % (prefix, fac.title)
    3030           
    3131class FacultyContainerFactory(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.