Ejemplo n.º 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
Ejemplo n.º 2
0
 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
     ])
Ejemplo n.º 3
0
 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])
Ejemplo n.º 4
0
 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
Ejemplo n.º 5
0
 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