Changeset 6160


Ignore:
Timestamp:
20 May 2011, 09:38:41 (14 years ago)
Author:
Henrik Bettermann
Message:

Change class attribute from list of dicts to dict. This makes configuration less error-prone.

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

Legend:

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

    r6159 r6160  
    130130        to assign each role to).
    131131        """
    132         return self._roles
     132        list_of_dict = [dict(name=x, title=self._roles[x]) for x in self._roles.keys()]
     133        return list_of_dict
    133134
    134135    def roles(self):
    135136        """Return a list of roles assignable to the context object.
    136137        """
    137         return [x['name'] for x in self._roles]
     138        return self._roles.keys()
  • main/waeup.sirp/trunk/src/waeup/sirp/university/department.py

    r6152 r6160  
    1515    @property       # Make this method read_only and looking like an attr.
    1616    def local_roles(cls):
    17         return [
    18             {'name':'waeup.local.DepartmentOfficer',
    19              'title':'Department Officer'},
    20             ]
     17        return {
     18            'waeup.local.DepartmentOfficer':'Department Officer',
     19            }
    2120
    2221    # A simple counter for ids.
  • main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.py

    r6145 r6160  
    1616    @property       # Make this method read_only and looking like an attr.
    1717    def local_roles(cls):
    18         return [
    19             {'name':'waeup.local.DepartmentOfficer',
    20              'title':'Department Officer'},
    21             ]
     18        return {
     19            'waeup.local.DepartmentOfficer':'Department Officer',
     20            }
    2221
    2322    def __init__(self,
Note: See TracChangeset for help on using the changeset viewer.