Q:

Building a tuple to be rendered by a form

I have a model University which has a field city. I'm trying to build a form where the user can select cities or universities. The universities selection is fine:
universities = University.objects.all()
university = forms.ModelMultipleChoiceField(widget=CheckboxSelectMultiple, queryset=universities)

The method I'm trying to get the cities is what is causing me the problem. Here's what I currently have:
cities = []
    for uni in universities:
        cities.append(uni.city)
    cities = tuple(cities)

    city_select = forms.MultipleChoiceField(widget=CheckboxSelectMultiple, choices=cities)

This gives me the error too many values to unpack because the tuple isn't key paired. Is there any easier way to return the choices I've gathered, I feel like I'm going about it in the wrong way. If not, how do I key pair the tuples of cities?

A:

I think a simple change like below, where each entry in cities is a tuple should make this work:
cities = []
    for uni in universities:
        cities.append((uni.city, uni.city))
    cities = tuple(cities)

    city_select = forms.MultipleChoiceField(widget=CheckboxSelectMultiple, choices=cities)

