Skip to content

sorting list of timezones on ModelForm? #116

@ccurvey

Description

@ccurvey

I can't be the first person to ask this...I feel like I'm having a brain cramp.

class Profile(models.Model):
    timezone = TimeZoneField(default="America/New_York")

class ProfileForm(forms.ModelForm):
    class Meta:
        model = Profile
        fields = ['timezone']

I get the list of timezones in a nice drop-down when I show my form, but they're in a random(?) order. How can I get them sorted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions