def __init__(self, *args, **kwargs): super(NewLanguageForm, self).__init__(*args, **kwargs) choices = sort_choices([(l.code, l.__unicode__()) for l in Language.objects.all()]) self.fields['lang'].choices = choices
def __init__(self, component, *args, **kwargs): super(NewLanguageOwnerForm, self).__init__(*args, **kwargs) languages = Language.objects.exclude(translation__subproject=component) self.fields['lang'].choices = sort_choices([ (l.code, force_text(l)) for l in languages ])
def __init__(self, component, *args, **kwargs): super(NewLanguageOwnerForm, self).__init__(*args, **kwargs) languages = Language.objects.exclude(translation__subproject=component) self.fields['lang'].choices = sort_choices([(l.code, force_text(l)) for l in languages])
def __init__(self, *args, **kwargs): super(NewLanguageForm, self).__init__(*args, **kwargs) choices = sort_choices([('', _('Please select'))] + [ (l.code, l.__unicode__()) for l in Language.objects.all() ]) self.fields['lang'].choices = choices
def __init__(self, *args, **kwargs): super(NewLanguageForm, self).__init__(*args, **kwargs) choices = sort_choices([('', _('Please select'))] + [(l.code, force_text(l)) for l in Language.objects.all()]) self.fields['lang'].choices = choices