@@ -0,0 +1,13 | |||
|
1 | {% extends "dev_conf_edit.html" %} | |
|
2 | ||
|
3 | {% block extra-js%} | |
|
4 | ||
|
5 | <script type="text/javascript"> | |
|
6 | ||
|
7 | $("#id_name").change(function() { | |
|
8 | var url = "{% url 'url_change_jars_filter' conf_id %}"; | |
|
9 | document.location = url + $(this).val()+"/"; | |
|
10 | }); | |
|
11 | ||
|
12 | </script> | |
|
13 | {% endblock %} |
@@ -1,2 +1,3 | |||
|
1 |
[{"fields": {"name": "49_92 |
|
|
2 | ] | |
|
1 | [{"fields": {"name": "49_92MHz_clock60MHz_F1KHz_12_25_2", "clock": 60, "mult": 5, "fch": 49.92, "fch_decimal": 721554506, "filter_fir": 2, "filter_2": 12, "filter_5": 25}, "model": "jars.jarsfilter", "pk": 1} | |
|
2 | {"fields": {"name": "49_920MHz_clock60MHz_F1MHz_10_1_6", "clock": 60, "mult": 5, "fch": 49.92, "fch_decimal": 721554506, "filter_fir": 6, "filter_2": 10, "filter_5": 1}, "model": "jars.jarsfilter", "pk": 2} | |
|
3 | ] |
@@ -4,6 +4,14 from django import forms | |||
|
4 | 4 | from apps.main.models import Device, Experiment |
|
5 | 5 | from .models import JARSConfiguration, JARSfilter |
|
6 | 6 | from .widgets import SpectralWidget |
|
7 | from apps.main.forms import add_empty_choice | |
|
8 | ||
|
9 | def create_choices_from_model(model, filter_id=None): | |
|
10 | ||
|
11 | #instance = globals()[model] | |
|
12 | choices = model.objects.all().values_list('pk', 'name') | |
|
13 | choices = add_empty_choice(choices) | |
|
14 | return choices | |
|
7 | 15 | |
|
8 | 16 | class JARSConfigurationForm(forms.ModelForm): |
|
9 | 17 | def __init__(self, *args, **kwargs): |
@@ -41,16 +49,36 class JARSfilterForm(forms.ModelForm): | |||
|
41 | 49 | instance = getattr(self, 'instance', None) |
|
42 | 50 | |
|
43 | 51 | self.fields['fch_decimal'].widget.attrs['readonly'] = True |
|
44 | ||
|
52 | ||
|
45 | 53 | if 'initial' in kwargs: |
|
46 | self.fields.pop('name') | |
|
47 | #self.fields['name'].widget.attrs['disabled'] = 'disabled' | |
|
48 | ||
|
54 | if 'filter_id' not in kwargs['initial']: | |
|
55 | self.fields.pop('name') | |
|
56 | else: | |
|
57 | self.fields['name'] = forms.ChoiceField(choices=create_choices_from_model(JARSfilter)) | |
|
58 | filter_id = kwargs['initial']['filter_id'] | |
|
59 | ||
|
60 | if filter_id == 0: | |
|
61 | for value in self.fields: | |
|
62 | if value != 'name': | |
|
63 | self.fields.pop(value) | |
|
64 | self.fields['name'].label = "Filter Template Name" | |
|
65 | else: | |
|
66 | self.fields['name'] = forms.ChoiceField(choices=create_choices_from_model(JARSfilter, kwargs['initial']['filter_id'])) | |
|
67 | jars_filter = JARSfilter.objects.get(pk=kwargs['initial']['filter_id']) | |
|
68 | labels = [f.name for f in jars_filter._meta.get_fields()] | |
|
69 | ||
|
70 | for label in ['id', 'jarsconfiguration']: | |
|
71 | labels.remove(label) | |
|
72 | for label in labels: | |
|
73 | self.fields['name'].initial = kwargs['initial']['filter_id'] | |
|
74 | self.fields[label].initial = getattr(jars_filter,label) | |
|
75 | self.fields['name'].label = "Filter Template Name" | |
|
49 | 76 | |
|
50 | 77 | class Meta: |
|
51 | 78 | model = JARSfilter |
|
52 | 79 | exclude = ('type', 'parameters', 'status') |
|
53 | 80 | |
|
81 | ||
|
54 | 82 | class ExtFileField(forms.FileField): |
|
55 | 83 | """ |
|
56 | 84 | Same as forms.FileField, but you can specify a file extension whitelist. |
@@ -33,12 +33,11 class JARSfilter(models.Model): | |||
|
33 | 33 | name = models.CharField(max_length=60, unique=True, default='') |
|
34 | 34 | clock = models.FloatField(verbose_name='Clock In (MHz)',validators=[MinValueValidator(5), MaxValueValidator(75)], null=True, default=60) |
|
35 | 35 | mult = models.PositiveIntegerField(verbose_name='Multiplier',validators=[MinValueValidator(1), MaxValueValidator(20)], default=5) |
|
36 |
fch = models. |
|
|
36 | fch = models.FloatField(verbose_name='Frequency (MHz)', validators=[MaxValueValidator(150)], null=True, default=49.9200) | |
|
37 | 37 | fch_decimal = models.BigIntegerField(verbose_name='Frequency (Decimal)',validators=[MinValueValidator(-9223372036854775808), MaxValueValidator(2**JARS_NBITS-1)], null=True, default=721554505) |
|
38 | 38 | filter_2 = models.PositiveIntegerField(verbose_name='Filter 2',validators=[MinValueValidator(2), MaxValueValidator(100)], default = 10) |
|
39 | 39 | filter_5 = models.PositiveIntegerField(verbose_name='Filter 5',validators=[MinValueValidator(1), MaxValueValidator(100)], default = 1) |
|
40 | 40 | filter_fir = models.PositiveIntegerField(verbose_name='FIR Filter',validators=[MinValueValidator(1), MaxValueValidator(100)], default = 6) |
|
41 | #speed = models.PositiveIntegerField(verbose_name='Speed',validators=[MinValueValidator(0), MaxValueValidator(100000)], default = 0) | |
|
42 | 41 | |
|
43 | 42 | class Meta: |
|
44 | 43 | db_table = 'jars_filters' |
@@ -58,7 +57,6 class JARSfilter(models.Model): | |||
|
58 | 57 | parameters['filter_fir'] = int(self.filter_fir) |
|
59 | 58 | parameters['filter_2'] = int(self.filter_2) |
|
60 | 59 | parameters['filter_5'] = int(self.filter_5) |
|
61 | #parameters['speed'] = int(self.speed) | |
|
62 | 60 | |
|
63 | 61 | return parameters |
|
64 | 62 | |
@@ -72,7 +70,6 class JARSfilter(models.Model): | |||
|
72 | 70 | self.filter_fir = parameters['filter_fir'] |
|
73 | 71 | self.filter_2 = parameters['filter_2'] |
|
74 | 72 | self.filter_5 = parameters['filter_5'] |
|
75 | #self.speed = parameters['speed'] | |
|
76 | 73 | |
|
77 | 74 | |
|
78 | 75 | class JARSConfiguration(Configuration): |
@@ -83,13 +80,10 class JARSConfiguration(Configuration): | |||
|
83 | 80 | BEGIN_ON_START = True |
|
84 | 81 | REFRESH_RATE = 1 |
|
85 | 82 | |
|
86 | #rc = models.ForeignKey(RCConfiguration, on_delete=models.CASCADE, null=True) | |
|
87 | 83 | exp_type = models.PositiveIntegerField(verbose_name='Experiment Type', choices=EXPERIMENT_TYPE, default=0) |
|
88 | 84 | cards_number = models.PositiveIntegerField(verbose_name='Number of Cards', validators=[MinValueValidator(1), MaxValueValidator(4)], default = 1) |
|
89 | 85 | channels_number = models.PositiveIntegerField(verbose_name='Number of Channels', validators=[MinValueValidator(1), MaxValueValidator(8)], default = 5) |
|
90 | 86 | channels = models.CharField(verbose_name='Channels', max_length=15, default = '1,2,3,4,5') |
|
91 | #rd_directory = models.CharField(verbose_name='Raw Data Directory', max_length=200, default='', blank=True, null=True) | |
|
92 | #pd_directory = models.CharField(verbose_name='Process Data Directory', max_length=200, default='', blank=True, null=True) | |
|
93 | 87 | data_type = models.PositiveIntegerField(verbose_name='Data Type', choices=DATA_TYPE, default=0) |
|
94 | 88 | raw_data_blocks = models.PositiveIntegerField(verbose_name='Raw Data Blocks', validators=[MaxValueValidator(5000)], default=60) |
|
95 | 89 | profiles_block = models.PositiveIntegerField(verbose_name='Profiles Per Block', default=400) |
@@ -106,11 +100,10 class JARSConfiguration(Configuration): | |||
|
106 | 100 | spectral = models.CharField(verbose_name='Combinations', max_length=5000, default = '[0, 0],') |
|
107 | 101 | create_directory = models.BooleanField(verbose_name='Create Directory Per Day', default=True) |
|
108 | 102 | include_expname = models.BooleanField(verbose_name='Experiment Name in Directory', default=False) |
|
109 | #acq_link = models.BooleanField(verbose_name='Acquisition Link', default=True) | |
|
110 | 103 | #view_raw_data = models.BooleanField(verbose_name='View Raw Data', default=True) |
|
111 | 104 | save_ch_dc = models.BooleanField(verbose_name='Save Channels DC', default=True) |
|
112 | 105 | save_data = models.BooleanField(verbose_name='Save Data', default=True) |
|
113 | filter_parms = models.CharField(max_length=10000, default='{}') | |
|
106 | filter_parms = models.CharField(max_length=10000, default='{"name": "49_92MHz_clock60MHz_F1KHz_12_25_2", "clock": 60, "mult": 5, "fch": 49.92, "fch_decimal": 721554506, "filter_fir": 2, "filter_2": 12, "filter_5": 25}, "model": "jars.jarsfilter", "pk": 1}') | |
|
114 | 107 | |
|
115 | 108 | class Meta: |
|
116 | 109 | db_table = 'jars_configurations' |
@@ -119,6 +112,19 class JARSConfiguration(Configuration): | |||
|
119 | 112 | self.filter_parms = self.filter.parms_to_dict() |
|
120 | 113 | self.save() |
|
121 | 114 | |
|
115 | def filter_resolution(self): | |
|
116 | filter_parms = eval(self.filter_parms) | |
|
117 | if filter_parms.__class__.__name__=='str': | |
|
118 | filter_parms = eval(filter_parms) | |
|
119 | ||
|
120 | filter_clock = filter_parms['clock'] | |
|
121 | filter_2 = filter_parms['filter_2'] | |
|
122 | filter_5 = filter_parms['filter_5'] | |
|
123 | filter_fir = filter_parms['filter_fir'] | |
|
124 | ||
|
125 | resolution = round((filter_clock/(filter_2*filter_5*filter_fir)),2) | |
|
126 | return resolution | |
|
127 | ||
|
122 | 128 | def dict_to_parms(self, params, id=None): |
|
123 | 129 | |
|
124 | 130 | if id is not None: |
@@ -1,1 +1,16 | |||
|
1 | {% extends "dev_conf.html" %} No newline at end of file | |
|
1 | {% extends "dev_conf.html" %} | |
|
2 | {% load static %} | |
|
3 | {% load bootstrap3 %} | |
|
4 | {% load main_tags %} | |
|
5 | ||
|
6 | ||
|
7 | {% block extra-content %} | |
|
8 | ||
|
9 | <div class="clearfix"></div> | |
|
10 | <h2>JARS filter: {{resolution}} (MHz)</h2> | |
|
11 | <hr> | |
|
12 | <div class="panel-group" id="div_lines" role="tablist" aria-multiselectable="true"> | |
|
13 | {% include "jars_filter.html" %} | |
|
14 | </div> | |
|
15 | ||
|
16 | {% endblock extra-content%} |
@@ -8,26 +8,25 | |||
|
8 | 8 | {% csrf_token %} |
|
9 | 9 | {% bootstrap_form form layout='horizontal' size='medium' %} |
|
10 | 10 | <div style="clear: both;"></div> |
|
11 | <br> | |
|
12 | <div class="pull-right"> | |
|
13 | <button type="button" class="btn btn-primary" id="bt_view_filter">View Filter</button> | |
|
14 | <!-- <button type="button" class="btn btn-primary" onclick="{% if previous %}window.location.replace('{{ previous }}');{% else %}history.go(-1);{% endif %}">Cancel</button> --> | |
|
15 | <button type="button" class="btn btn-primary" id="bt_cancel">Cancel</button> | |
|
16 | <button type="submit" class="btn btn-primary">{{button}}</button> | |
|
11 | <h2>JARS filter</h2> | |
|
12 | <hr> | |
|
13 | <div class="panel-group" id="div_lines" role="tablist" aria-multiselectable="true"> | |
|
14 | {% include "jars_filter_edit.html" %} | |
|
17 | 15 | </div> |
|
16 | <div style="clear: both;"></div> | |
|
17 | <br> | |
|
18 | 18 | </form> |
|
19 | 19 | {% endblock %} |
|
20 | 20 | |
|
21 | ||
|
21 | 22 | {% block extra-js%} |
|
22 | 23 | <script src="{% static 'js/jars.js' %}"></script> |
|
23 | 24 | |
|
24 | 25 | <script type="text/javascript"> |
|
25 | $("#bt_view_filter").click(function() { | |
|
26 | document.location = "{% url 'url_jars_filter' id_dev filter_id%}"; | |
|
27 | }); | |
|
28 | ||
|
26 | ||
|
29 | 27 | $("#bt_cancel").click(function() { |
|
30 | 28 | document.location = "{% url 'url_jars_conf' id_dev %}"; |
|
31 |
|
|
|
29 | }); | |
|
30 | ||
|
32 | 31 | </script> |
|
33 | {% endblock %} No newline at end of file | |
|
32 | {% endblock %} |
@@ -1,13 +1,7 | |||
|
1 | {% extends "base.html" %} | |
|
2 | 1 | {% load bootstrap3 %} |
|
3 | 2 | {% load static %} |
|
4 | 3 | {% load main_tags %} |
|
5 | 4 | |
|
6 | {% block search-active %}active{% endblock %} | |
|
7 | ||
|
8 | {% block content-title %}{{title}}{% endblock %} | |
|
9 | {% block content-suptitle %}{{suptitle}}{% endblock %} | |
|
10 | ||
|
11 | 5 | {% block content %} |
|
12 | 6 | |
|
13 | 7 | {% block menu-actions %} |
@@ -15,45 +9,19 | |||
|
15 | 9 | {% endblock %} |
|
16 | 10 | |
|
17 | 11 | <table class="table table-bordered"> |
|
18 | ||
|
19 | {% for key in dev_conf_keys %} | |
|
20 | <tr> | |
|
21 | <th>{% get_verbose_field_name dev_conf key %}</th> | |
|
22 | <td>{{dev_conf|attr:key}}</td> | |
|
23 | </tr> | |
|
24 | {% endfor %} | |
|
12 | ||
|
13 | <tr> <th>Clock in (MHz)</th><td>{{filter.clock}}</td> </tr> | |
|
14 | <tr> <th>Multiplier</th><td>{{filter.mult}}</td> </tr> | |
|
15 | <tr> <th>Frequency (MHz)</th><td>{{filter.fch}}</td> </tr> | |
|
16 | <tr> <th>Frequency (Decimal)</th><td>{{filter.fch_decimal}}</td> </tr> | |
|
17 | <tr> <th>Filter 2</th><td>{{filter.filter_2}}</td> </tr> | |
|
18 | <tr> <th>Filter 5</th><td>{{filter.filter_5}}</td> </tr> | |
|
19 | <tr> <th>FIR Filter</th><td>{{filter.filter_fir}}</td> </tr> | |
|
20 | ||
|
25 | 21 | </table> |
|
26 | {% if button %} | |
|
27 | <div class="pull-right"> | |
|
28 | <button type="button" class="btn btn-primary" id="back_button">{% if cancel %}{{cancel}}{% else %}Back{% endif %}</button> | |
|
29 | <button type="button" id="edit_button" class="btn btn-primary">{{edit_button}}</button> | |
|
30 | <button type="button" id="new_button" class="btn btn-primary">{{add_button}}</button> | |
|
31 | </div> | |
|
32 | {% endif %} | |
|
33 | 22 | |
|
34 | {% block extra-content %} | |
|
35 | {% endblock %} | |
|
36 | 23 | |
|
24 | {% block extra-content %} | |
|
37 | 25 | {% endblock %} |
|
38 | 26 | |
|
39 | {% block sidebar%} | |
|
40 | {% include "sidebar_devices.html" %} | |
|
41 | 27 | {% endblock %} |
|
42 | ||
|
43 | {% block extra-js%} | |
|
44 | <script type="text/javascript"> | |
|
45 | ||
|
46 | $("#edit_button").click(function() { | |
|
47 | document.location = "{% url 'url_edit_jars_filter' conf.id filter.id%}"; | |
|
48 | }); | |
|
49 | ||
|
50 | $("#back_button").click(function() { | |
|
51 | document.location = "{% url 'url_edit_jars_conf' conf.id%}"; | |
|
52 | }); | |
|
53 | ||
|
54 | $("#new_button").click(function() { | |
|
55 | document.location = "{% url 'url_new_jars_filter' conf.id%}"; | |
|
56 | }); | |
|
57 | ||
|
58 | </script> | |
|
59 | {% endblock %} No newline at end of file |
@@ -1,4 +1,3 | |||
|
1 | {% extends "dev_conf_edit.html" %} | |
|
2 | 1 | {% load bootstrap3 %} |
|
3 | 2 | {% load static %} |
|
4 | 3 | {% load main_tags %} |
@@ -6,16 +5,25 | |||
|
6 | 5 | {% block content %} |
|
7 | 6 | <form class="form" method="post"> |
|
8 | 7 | {% csrf_token %} |
|
9 | {% bootstrap_form form layout='horizontal' size='medium' %} | |
|
8 | {% bootstrap_form filter_form layout='horizontal' size='medium' %} | |
|
10 | 9 | <div style="clear: both;"></div> |
|
11 | 10 | <br> |
|
12 | 11 | <div class="pull-right"> |
|
13 | <button type="button" class="btn btn-primary" onclick="{% if previous %}window.location.replace('{{ previous }}');{% else %}history.go(-1);{% endif %}">Cancel</button> | |
|
14 |
<button type=" |
|
|
12 | <button type="button" class="btn btn-primary" onclick="{% if previous %}window.location.replace('{{ previous }}');{% else %}history.go(-1);{% endif %}">Cancel</button> | |
|
13 | <button type="button" class="btn btn-primary" id="bt_change_filter">Change Filter</button> | |
|
14 | <button type="submit" class="btn btn-primary">{{button}}</button> | |
|
15 | 15 | </div> |
|
16 | 16 | </form> |
|
17 | 17 | {% endblock %} |
|
18 | 18 | |
|
19 | 19 | {% block extra-js%} |
|
20 | 20 | <script src="{% static 'js/filters.js' %}"></script> |
|
21 | {% endblock %} No newline at end of file | |
|
21 | ||
|
22 | <script type="text/javascript"> | |
|
23 | ||
|
24 | $("#bt_change_filter").click(function() { | |
|
25 | document.location = "{% url 'url_change_jars_filter' id_dev %}"; | |
|
26 | }); | |
|
27 | ||
|
28 | </script> | |
|
29 | {% endblock %} |
@@ -6,6 +6,8 urlpatterns = ( | |||
|
6 | 6 | url(r'^(?P<id_conf>-?\d+)/$', views.jars_conf, name='url_jars_conf'), |
|
7 | 7 | url(r'^(?P<id_conf>-?\d+)/edit/$', views.jars_conf_edit, name='url_edit_jars_conf'), |
|
8 | 8 | url(r'^(?P<conf_id>-?\d+)/new_filter/$', views.new_filter, name='url_new_jars_filter'), |
|
9 | url(r'^(?P<conf_id>-?\d+)/change_filter/$', views.change_filter, name='url_change_jars_filter'), | |
|
10 | url(r'^(?P<conf_id>-?\d+)/change_filter/(?P<filter_id>-?\d+)/$', views.change_filter, name='url_change_jars_filter'), | |
|
9 | 11 | url(r'^(?P<conf_id>-?\d+)/view_filter/(?P<filter_id>-?\d+)/$', views.view_filter, name='url_jars_filter'), |
|
10 | 12 | url(r'^(?P<conf_id>-?\d+)/view_filter/(?P<filter_id>-?\d+)/edit$', views.edit_filter, name='url_edit_jars_filter'), |
|
11 | 13 | url(r'^(?P<conf_id>-?\d+)/import/$', views.import_file, name='url_import_jars_conf'), |
@@ -8,16 +8,25 from apps.main.views import sidebar | |||
|
8 | 8 | |
|
9 | 9 | from .models import JARSConfiguration, JARSfilter |
|
10 | 10 | from .forms import JARSConfigurationForm, JARSfilterForm, JARSImportForm |
|
11 | ||
|
12 | import json | |
|
11 | 13 | # Create your views here. |
|
12 | 14 | |
|
13 | 15 | def jars_conf(request, id_conf): |
|
14 | 16 | |
|
15 | 17 | conf = get_object_or_404(JARSConfiguration, pk=id_conf) |
|
16 | 18 | |
|
17 | ip=conf.device.ip_address | |
|
18 | port=conf.device.port_address | |
|
19 | filter_parms = eval(conf.filter_parms) | |
|
20 | if filter_parms.__class__.__name__=='str': | |
|
21 | filter_parms = eval(filter_parms) | |
|
19 | 22 | |
|
20 | 23 | kwargs = {} |
|
24 | kwargs['filter'] = filter_parms | |
|
25 | kwargs['filter_keys'] = ['clock', 'mult', 'fch', 'fch_decimal', | |
|
26 | 'filter_fir', 'filter_2', 'filter_5'] | |
|
27 | filter_resolution=conf.filter_resolution() | |
|
28 | kwargs['resolution'] = filter_resolution | |
|
29 | ||
|
21 | 30 | kwargs['status'] = conf.device.get_status_display() |
|
22 | 31 | |
|
23 | 32 | |
@@ -50,24 +59,36 def jars_conf_edit(request, id_conf): | |||
|
50 | 59 | |
|
51 | 60 | conf = get_object_or_404(JARSConfiguration, pk=id_conf) |
|
52 | 61 | |
|
62 | filter_parms = eval(conf.filter_parms) | |
|
63 | if filter_parms.__class__.__name__=='str': | |
|
64 | filter_parms = eval(filter_parms) | |
|
65 | ||
|
53 | 66 | if request.method=='GET': |
|
54 | 67 | form = JARSConfigurationForm(instance=conf) |
|
68 | filter_form = JARSfilterForm(initial=filter_parms) | |
|
55 | 69 | |
|
56 | 70 | if request.method=='POST': |
|
57 | 71 | form = JARSConfigurationForm(request.POST, instance=conf) |
|
72 | filter_form = JARSfilterForm(request.POST) | |
|
73 | ||
|
74 | if filter_form.is_valid(): | |
|
75 | jars_filter = filter_form.cleaned_data | |
|
76 | try: | |
|
77 | jars_filter.pop('name') | |
|
78 | except: | |
|
79 | pass | |
|
58 | 80 | |
|
59 | 81 | if form.is_valid(): |
|
60 | 82 | conf = form.save(commit=False) |
|
83 | conf.filter_parms = json.dumps(jars_filter) | |
|
61 | 84 | conf.save() |
|
62 | 85 | return redirect('url_jars_conf', id_conf=conf.id) |
|
63 | 86 | |
|
64 | ##ERRORS | |
|
65 | ||
|
66 | 87 | kwargs = {} |
|
67 | 88 | |
|
68 | kwargs['filter_id'] = 1 | |
|
69 | 89 | kwargs['id_dev'] = conf.id |
|
70 | 90 | kwargs['form'] = form |
|
91 | kwargs['filter_form'] = filter_form | |
|
71 | 92 | kwargs['title'] = 'Device Configuration' |
|
72 | 93 | kwargs['suptitle'] = 'Edit' |
|
73 | 94 | kwargs['button'] = 'Save' |
@@ -244,3 +265,29 def new_filter(request, conf_id): | |||
|
244 | 265 | kwargs['dev_conf'] = conf |
|
245 | 266 | |
|
246 | 267 | return render(request, 'jars_new_filter.html', kwargs) |
|
268 | ||
|
269 | ||
|
270 | def change_filter(request, conf_id, filter_id=None): | |
|
271 | ||
|
272 | conf = get_object_or_404(JARSConfiguration, pk=conf_id) | |
|
273 | ||
|
274 | if filter_id: | |
|
275 | if filter_id.__class__.__name__ not in ['int', 'float']: | |
|
276 | filter_id = eval(filter_id) | |
|
277 | ||
|
278 | if filter_id == 0: | |
|
279 | return redirect('url_change_jars_filter', conf_id=conf.id) | |
|
280 | ||
|
281 | if request.method=='GET': | |
|
282 | if not filter_id: | |
|
283 | form = JARSfilterForm(initial={'jars_configuration':conf_id, 'filter_id': 0}) | |
|
284 | else: | |
|
285 | form = JARSfilterForm(initial={'jars_configuration':conf_id, 'filter_id': filter_id}) | |
|
286 | ||
|
287 | kwargs = {} | |
|
288 | kwargs['title'] = 'JARS Configuration' | |
|
289 | kwargs['suptitle'] = 'Change Filter' | |
|
290 | kwargs['form'] = form | |
|
291 | kwargs['conf_id'] = conf.id | |
|
292 | kwargs['filter_id'] = filter_id | |
|
293 | return render(request, 'change_jars_filter.html', kwargs) |
General Comments 0
You need to be logged in to leave comments.
Login now