@@ -12,10 +12,10 class CGSConfiguration(Configuration): | |||||
12 |
|
12 | |||
13 | #device = models.ForeignKey(Device) |
|
13 | #device = models.ForeignKey(Device) | |
14 | #exp = models.ForeignKey(Experiment, default = None) |
|
14 | #exp = models.ForeignKey(Experiment, default = None) | |
15 | freq0 = models.FloatField(verbose_name='Frequency 0',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) |
|
15 | freq0 = models.FloatField(verbose_name='Frequency 0',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)], blank=True, null=True) | |
16 | freq1 = models.FloatField(verbose_name='Frequency 1',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) |
|
16 | freq1 = models.FloatField(verbose_name='Frequency 1',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)], blank=True, null=True) | |
17 | freq2 = models.FloatField(verbose_name='Frequency 2',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)]) |
|
17 | freq2 = models.FloatField(verbose_name='Frequency 2',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)], blank=True, null=True) | |
18 |
freq3 = models. |
|
18 | freq3 = models.FloatField(verbose_name='Frequency 3',validators=[MinValueValidator(62.5e6), MaxValueValidator(450e6)], blank=True, null=True) | |
19 | #jfreqs = JSONField(default={"frequencies":[{"f0":freq0,"f1":freq1,"f2":freq2,"f3":freq3}]}, blank=True) |
|
19 | #jfreqs = JSONField(default={"frequencies":[{"f0":freq0,"f1":freq1,"f2":freq2,"f3":freq3}]}, blank=True) | |
20 | #clk_in = models.PositiveIntegerField(default=10e6) |
|
20 | #clk_in = models.PositiveIntegerField(default=10e6) | |
21 | #mult = models.PositiveIntegerField(default=40) |
|
21 | #mult = models.PositiveIntegerField(default=40) |
@@ -9,6 +9,32 | |||||
9 | <p class="text-justify"> |
|
9 | <p class="text-justify"> | |
10 | Ingresar Frecuencias |
|
10 | Ingresar Frecuencias | |
11 | </p> |
|
11 | </p> | |
|
12 | ||||
|
13 | ||||
|
14 | ||||
|
15 | <!-- Agregado 30-11-2015 --> | |||
|
16 | {% if form.is_multipart %} | |||
|
17 | ||||
|
18 | <script type="text/javascript"> | |||
|
19 | ||||
|
20 | </script> | |||
|
21 | ||||
|
22 | <form id="{{ idform }}" enctype="multipart/form-data" method="{{ submit_method|default:'post' }}" action="" class="form"> | |||
|
23 | {% else %} | |||
|
24 | <form method="{{ submit_method|default:'post' }}" action="" class="form"> | |||
|
25 | {% endif %} | |||
|
26 | ||||
|
27 | {% if step_field %} | |||
|
28 | <input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> | |||
|
29 | {% endif %} | |||
|
30 | ||||
|
31 | {% if submit_method != 'GET' and submit_method != 'get' %} | |||
|
32 | {% csrf_token %} | |||
|
33 | {% endif %} | |||
|
34 | <!-- Agregado 30-11-2015 --> | |||
|
35 | ||||
|
36 | ||||
|
37 | ||||
12 | <div class='col-md-8'> |
|
38 | <div class='col-md-8'> | |
13 | {% bootstrap_form form size='medium' %} |
|
39 | {% bootstrap_form form size='medium' %} | |
14 | <button type="submit" class="btn btn-primary pull-right">Submit</button> |
|
40 | <button type="submit" class="btn btn-primary pull-right">Submit</button> |
@@ -24,6 +24,21 def configurate_frequencies(request, id=0): | |||||
24 | 'devices':devices, |
|
24 | 'devices':devices, | |
25 | 'title': ('YAP'), |
|
25 | 'title': ('YAP'), | |
26 | } |
|
26 | } | |
|
27 | ||||
|
28 | if request.method == 'POST': | |||
|
29 | form = CGSConfigurationForm(request.POST) #, initial={'purchase_request':purchase_request}) | |||
|
30 | if form.is_valid(): | |||
|
31 | instance = form.save(commit=False) | |||
|
32 | #if 'quote' in request.FILES: | |||
|
33 | # instance.quoe = request.FILES['quote'] | |||
|
34 | instance.save() | |||
|
35 | form.save_m2m() | |||
|
36 | msg = _(u'The frequencies have been activated successfully.') | |||
|
37 | messages.success(request, msg, fail_silently=True) | |||
|
38 | #return redirect(purchase_request.get_absolute_url()) | |||
|
39 | else: | |||
|
40 | form = CGSConfigurationForm() | |||
|
41 | ||||
27 |
|
42 | |||
28 | return render_to_response('index_cgs.html', data, context_instance=RequestContext(request)) |
|
43 | return render_to_response('index_cgs.html', data, context_instance=RequestContext(request)) | |
29 | #return render_to_response("index.html", kwargs, context_instance=RequestContext(request)) |
|
44 | #return render_to_response("index.html", kwargs, context_instance=RequestContext(request)) |
General Comments 0
You need to be logged in to leave comments.
Login now