'Generate the current list of repositories for resetting metadata.'

def build_repository_ids_select_field(self, name='repository_ids', multiple=True, display='checkboxes', my_writable=False):

    repositories_select_field = SelectField(name=name, multiple=multiple, display=display)
    query = self.get_query_for_setting_metadata_on_repositories(my_writable=my_writable, order=True)
    for repository in query:
        owner = str(repository.user.username)
        option_label = ('%s    (%s)' % (str(repository.name), owner))
        option_value = ('%s' % self.app.security.encode_id(repository.id))
        repositories_select_field.add_option(option_label, option_value)
    return repositories_select_field
