##// END OF EJS Templates
Task #95: se agrego la funcion "import" para archivos .json ...
Task #95: se agrego la funcion "import" para archivos .json git-svn-id: http://jro-dev.igp.gob.pe/svn/jro_hard/radarsys/trunk/webapp@63 aa17d016-51d5-4e8b-934c-7b2bbb1bbe71

File last commit:

r42:21a9f0375b43
r42:21a9f0375b43
Show More
forms.py
33 lines | 1.3 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):
#freq0.widget = te
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')
items = devices.values('id', 'name', 'device_type__name', 'ip_address')
self.fields['experiment'].widget.attrs['readonly'] = True
self.fields['device'].widget.choices = [(item['id'], '[%s]: %s | %s' % (item['device_type__name'], item['name'], item['ip_address'])) for item in items]
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
#exclude = ('freqs', 'clk_in', 'mult','div',)
Miguel Urco
CGS view updated...
r11 # exclude = ('freqs',)
Miguel Urco
Campaign has been added to RadarSys Model...
r13 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()