'Themes associated with this Project'

def themes(self):

    try:
        project_id = self.project_project.id
    except AttributeError:
        return ''
    s3db = current.s3db
    ptable = s3db.project_project
    ttable = s3db.project_theme
    ltable = s3db.project_theme_percentage
    query = (((ltable.deleted != True) & (ltable.project_id == project_id)) & (ltable.theme_id == ttable.id))
    themes = current.db(query).select(ttable.name, ltable.percentage)
    if (not themes):
        return current.messages['NONE']
    represent = ''
    for theme in themes:
        name = theme.project_theme.name
        percentage = theme.project_theme_percentage.percentage
        if represent:
            represent = ('%s,    %s    (%s%s)' % (represent, name, percentage, '%'))
        else:
            represent = ('%s    (%s%s)' % (name, percentage, '%'))
    return represent
