## Script (Python) "ts_get_my_spaces"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=returns a dict, keys are teams, values are tuples of spaces

ret = {}
memberships = context.portal_teams.getTeamMembershipsFor(active=1)

for mship in memberships:
    team = mship.getTeam()
    spaces = team.getTeamSpaces()
    if spaces:
        ret[team.title_or_id()] = spaces

return ret
