##// END OF EJS Templates
cgs updated...
Fiorella Quino -
r161:b7757d1e1a33
parent child
Show More
@@ -1,34 +1,33
1 1 from django import forms
2 2 from apps.main.models import Device
3 3 from .models import CGSConfiguration
4 4
5 5 class CGSConfigurationForm(forms.ModelForm):
6 6
7 7 def __init__(self, *args, **kwargs):
8 8 #request = kwargs.pop('request')
9 9 super(CGSConfigurationForm, self).__init__(*args, **kwargs)
10 10
11 11 instance = getattr(self, 'instance', None)
12 12
13 13 if instance and instance.pk:
14 14
15 15 devices = Device.objects.filter(device_type__name='cgs')
16 16
17 17 if instance.experiment:
18 18 self.fields['experiment'].widget.attrs['disabled'] = 'disabled'
19 19
20 20 self.fields['device'].widget.choices = [(device.id, device) for device in devices]
21
21
22 22 def clean(self):
23 return
24 #
23 return
25 24
26 25 class Meta:
27 26 model = CGSConfiguration
28 27 exclude = ('type', 'parameters', 'status')
29 28 #fields = ('experiment', 'device', 'freq0', 'freq1', 'freq2', 'freq3')
30 29
31 30
32 31 class UploadFileForm(forms.Form):
33 32 title = forms.CharField(label='Extension Type', widget=forms.TextInput(attrs={'readonly':'readonly'}))
34 33 file = forms.FileField()
General Comments 0
You need to be logged in to leave comments. Login now