##// END OF EJS Templates
sync repo...
sync repo git-svn-id: http://jro-dev.igp.gob.pe/svn/jro_hard/radarsys/trunk/webapp@178 aa17d016-51d5-4e8b-934c-7b2bbb1bbe71

File last commit:

r85:d4fe0e132735
r157:82791b88ae92
Show More
forms.py
33 lines | 1.1 KiB | text/x-python | PythonLexer
Fiorella Quino
CGS model, form, view, url and html have been added....
r4 from django import forms
Miguel Urco
Campaign has been added to RadarSys Model...
r13 from apps.main.models import Device
Fiorella Quino
CGS model, form, view, url and html have been added....
r4 from .models import CGSConfiguration
class CGSConfigurationForm(forms.ModelForm):
Juan C. Espinoza
Update several views and models in main app...
r85
Fiorella Quino
CGS model, form, view, url and html have been added....
r4 def __init__(self, *args, **kwargs):
#request = kwargs.pop('request')
super(CGSConfigurationForm, self).__init__(*args, **kwargs)
Miguel Urco
Campaign has been added to RadarSys Model...
r13 instance = getattr(self, 'instance', None)
if instance and instance.pk:
devices = Device.objects.filter(device_type__name='cgs')
Juan C. Espinoza
Update several views and models in main app...
r85 if instance.experiment:
self.fields['experiment'].widget.attrs['disabled'] = 'disabled'
self.fields['device'].widget.choices = [(device.id, device) for device in devices]
Miguel Urco
Campaign has been added to RadarSys Model...
r13
Fiorella Quino
CGS model, form, view, url and html have been added....
r4 def clean(self):
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return
Fiorella Quino
Task #95: se agrego la funcion "import" para archivos .json ...
r42 #
Fiorella Quino
CGS model, form, view, url and html have been added....
r4
class Meta:
model = CGSConfiguration
Juan C. Espinoza
Update several views and models in main app...
r85 exclude = ('type', 'parameters', 'status')
#fields = ('experiment', 'device', 'freq0', 'freq1', 'freq2', 'freq3')
Fiorella Quino
Task #95: se agrego la funcion "import" para archivos .json ...
r42
class UploadFileForm(forms.Form):
title = forms.CharField(label='Extension Type', widget=forms.TextInput(attrs={'readonly':'readonly'}))
file = forms.FileField()