コード例 #1
0
ファイル: forms.py プロジェクト: rvanlaar/easy-transifex
 def __init__(self, *args, **kwargs):
     super(ProjectForm, self).__init__(*args, **kwargs)
     # Disable the source_language widget when updating
     if self.instance and self.instance.id:
         if self.instance.resources.count():
             self.fields["source_language"].required = False
             self.fields["source_language"].widget.attrs["disabled"] = "disabled"
     project_form_init.send(sender=ProjectForm, form=self)
コード例 #2
0
ファイル: forms.py プロジェクト: 593in/transifex
    def __init__(self, *args, **kwargs):
        # we need this because the number of private projects validation may
        # depend on the owner's subscription
        self.owner = kwargs.pop('owner', None)

        super(ProjectForm, self).__init__(*args, **kwargs)
        # Disable the source_language widget when updating
        if self.instance and self.instance.id:
            if self.instance.resources.count():
                self.fields['source_language'].required = False
                self.fields['source_language'].widget.attrs['disabled'] = 'disabled'
        project_form_init.send(sender=ProjectForm, form=self)
コード例 #3
0
    def __init__(self, *args, **kwargs):
        # we need this because the number of private projects validation may
        # depend on the owner's subscription
        self.owner = kwargs.pop('owner', None)

        super(ProjectForm, self).__init__(*args, **kwargs)
        # Disable the source_language widget when updating
        if self.instance and self.instance.id:
            if self.instance.resources.count():
                self.fields['source_language'].required = False
                self.fields['source_language'].widget.attrs[
                    'disabled'] = 'disabled'
        project_form_init.send(sender=ProjectForm, form=self)
コード例 #4
0
ファイル: forms.py プロジェクト: hfeeki/transifex
 def __init__(self, *args, **kwargs):
     super(ProjectForm, self).__init__(*args, **kwargs)
     project_form_init.send(sender=ProjectForm, form=self)