Browse files

changing display widget of editing and creating filter form

  • Loading branch information...
1 parent f9234bb commit 28b28fba8ccc857cf9233efcad2ba3b9bde4b78e @agrausem agrausem committed Sep 4, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −1 setup.py
  2. +4 −1 src/sifac/forms.py
View
2 setup.py
@@ -5,7 +5,7 @@
setup(
name = 'django-sifac',
- version = '0.2.1',
+ version = '0.2.2',
packages = ['sifac', 'sifac.sap'],
package_dir = {'': 'src'},
View
5 src/sifac/forms.py
@@ -41,7 +41,10 @@ class SAPModelFilterForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(SAPModelFilterForm, self).__init__(*args, **kwargs)
- self.fields['sap_model_name'].widget = forms.Select(
+ if self.instance and self.instance.id:
+ self.fields['sap_model_name'].widget.attrs['readonly'] = True
+ else:
+ self.fields['sap_model_name'].widget = forms.Select(
choices=get_unfiltered_sap_models())
class Meta:

0 comments on commit 28b28fb

Please sign in to comment.