コード例 #1
0
 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
コード例 #2
0
ファイル: forms.py プロジェクト: Acidburn0zzz/weblate
 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
     ])
コード例 #3
0
ファイル: forms.py プロジェクト: sc123088/weblate
 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])
コード例 #4
0
ファイル: forms.py プロジェクト: phylophyl/weblate
 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
コード例 #5
0
ファイル: forms.py プロジェクト: Intrainos/weblate
 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