##// END OF EJS Templates
- Implementando la vista view del perfil.
jsalyrosas -
r125:126
parent child
Show More
@@ -0,0 +1,63
1 {% extends "abscontrol/index.html" %}
No newline at end of file
2 {% block title %}ABS CONTROL:::PROFILE:::{{ nameProfile }}{% endblock %}
No newline at end of file
3
No newline at end of file
4 {% block maincolumn%}
No newline at end of file
5 <div id="maincolumn">
No newline at end of file
6 <form action="/abscontrol/save/" method="post">
No newline at end of file
7 <div id="divProfile">
No newline at end of file
8 <label for="lblName">Profile:</label>
No newline at end of file
9 <label for="lblProfile">{{ nameProfile }}</label>
No newline at end of file
10 </div>
No newline at end of file
11 <div id="divPattern">
No newline at end of file
12 {% if patternChoosen %}
No newline at end of file
13 <label for="lblValue">Pattern:</label>
No newline at end of file
14 <label for="lblPatternValue">{{ patternChoosen.value }}</label>
No newline at end of file
15 {% endif %}
No newline at end of file
16 <div id="antennaUp">
No newline at end of file
17 <fieldset class="flsAntenna">
No newline at end of file
18 <legend>UP</legend>
No newline at end of file
19 <div class="divAntenna">
No newline at end of file
20 <label for="lblAntenna">Antenna</label>
No newline at end of file
21 <textarea name="txtAntennaUp" class="txtAntenna" cols="38" rows="8"></textarea>
No newline at end of file
22 </div>
No newline at end of file
23 <div class="divTx">
No newline at end of file
24 <label for="lblTx">Tx</label>
No newline at end of file
25 <textarea name="txtTxUp" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
26 </div>
No newline at end of file
27 <div class="divTx">
No newline at end of file
28 <label for="lblRx">Rx</label>
No newline at end of file
29 <textarea name="txtRxUp" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
30 </div>
No newline at end of file
31 <div class="cleardivs"></div>
No newline at end of file
32 <div class="divUes">
No newline at end of file
33 <label for="lblUes">Ues:</label>
No newline at end of file
34 <input type="text" name="txtUesUp" value="" />
No newline at end of file
35 </div>
No newline at end of file
36 </fieldset>
No newline at end of file
37 </div>
No newline at end of file
38 <div id="antennaDown">
No newline at end of file
39 <fieldset class="flsAntenna">
No newline at end of file
40 <legend>DOWN</legend>
No newline at end of file
41 <div class="divAntenna">
No newline at end of file
42 <label for="lblAntenna">Antenna</label>
No newline at end of file
43 <textarea name="txtAntennaDown" class="txtAntenna" cols="38" rows="8"></textarea>
No newline at end of file
44 </div>
No newline at end of file
45 <div class="divTx">
No newline at end of file
46 <label for="lblTx">Tx</label>
No newline at end of file
47 <textarea name="txtTxDown" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
48 </div>
No newline at end of file
49 <div class="divTx">
No newline at end of file
50 <label for="lblRx">Rx</label>
No newline at end of file
51 <textarea name="txtRxDown" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
52 </div>
No newline at end of file
53 <div class="cleardivs"></div>
No newline at end of file
54 <div class="divUes">
No newline at end of file
55 <label for="lblUes">Ues:</label>
No newline at end of file
56 <input type="text" name="txtUesDown" value="" />
No newline at end of file
57 </div>
No newline at end of file
58 </fieldset>
No newline at end of file
59 </div>
No newline at end of file
60 </div>
No newline at end of file
61 </form>
No newline at end of file
62 </div>
No newline at end of file
63 {% endblock %} No newline at end of file
@@ -1,42 +1,65
1 1 from django.shortcuts import render_to_response, redirect
2 No newline at end of file
2 from abscontrol.models import Profile No newline at end of file
3 3 No newline at end of file
4 4 def index(request): No newline at end of file
5 5 #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5] No newline at end of file
6 6 profile_list = Profile.objects.all() No newline at end of file
7 7 return render_to_response('abscontrol/index.html', {'profile_list': profile_list}) No newline at end of file
8 8 No newline at end of file
9 9 def new(request): No newline at end of file
10 10 profile_list = Profile.objects.all() No newline at end of file
11 11 return render_to_response('abscontrol/new.html', {'profile_list': profile_list}) No newline at end of file
12 12 No newline at end of file
13 13 def save(request): No newline at end of file
14 14 No newline at end of file
15 15 txtProfile = request.POST["txtProfile"] No newline at end of file
16 16 No newline at end of file
17 17 txtAntennaUp = request.POST["txtAntennaUp"] No newline at end of file
18 18 txtTxUp = request.POST["txtTxUp"] No newline at end of file
19 19 txtRxUp = request.POST["txtRxUp"] No newline at end of file
20 20 txtUesUp = request.POST["txtUesUp"] No newline at end of file
21 21 No newline at end of file
22 22 txtAntennaDown = request.POST["txtAntennaDown"] No newline at end of file
23 23 txtTxDown = request.POST["txtTxDown"] No newline at end of file
24 24 txtRxDown = request.POST["txtRxDown"] No newline at end of file
25 25 txtUesDown = request.POST["txtUesDown"] No newline at end of file
26 26 No newline at end of file
27 27 newprofile = Profile(name=txtProfile) No newline at end of file
28 28 newprofile.save() No newline at end of file
29 29 No newline at end of file
30 30 newpattern = newprofile.pattern_set.create(value=1) No newline at end of file
31 31 newpattern.antennaup_set.create(value=txtAntennaUp, No newline at end of file
32 32 tx=txtTxUp,rx=txtRxUp, No newline at end of file
33 33 ues=txtUesUp) No newline at end of file
34 34 newpattern.antennadown_set.create(value=txtAntennaDown, No newline at end of file
35 35 tx=txtTxDown,rx=txtRxDown, No newline at end of file
36 36 ues=txtUesDown) No newline at end of file
37 37
38 No newline at end of file
38 return redirect('/abscontrol/') No newline at end of file
No newline at end of file
39 #return redirect('/abscontrol/')
No newline at end of file
40 return redirect(newurl) No newline at end of file
39 41 No newline at end of file
40 42 def view(request, profile_id):
43 No newline at end of file
41 pass No newline at end of file
No newline at end of file
44 pattern_value = request.GET["pattern"]
No newline at end of file
45 else:
No newline at end of file
46 pattern_value = 1 No newline at end of file
42 47 No newline at end of file
48 profile_list = Profile.objects.all()
No newline at end of file
49 objProfile = Profile.objects.get(pk=profile_id)
No newline at end of file
50
No newline at end of file
51 lsPatterns = objProfile.pattern_set.all()
No newline at end of file
52 patternChoosen = objProfile.pattern_set.filter(value=pattern_value)
No newline at end of file
53 #print patternChoosen.value
No newline at end of file
54 #objAntennaUp = patternChoosen.antennaup_set.all()[0]
No newline at end of file
55 #objAntennaDown = patternChoosen.antennadown_set.all()[0]
No newline at end of file
56
No newline at end of file
57 #objAntennaUp = AntennaUp.objects.get(pattern=patternChoosen.id)
No newline at end of file
58 #objAntennaDown = AntennaDown.objects.get(pattern=patternChoosen.id)
No newline at end of file
59 '''
No newline at end of file
60 return render_to_response('abscontrol/view.html', {'nameProfile': objProfile.name, 'profile_list': profile_list,
No newline at end of file
61 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
No newline at end of file
62 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,})
No newline at end of file
63 '''
No newline at end of file
64 return render_to_response('abscontrol/view.html', {'nameProfile': objProfile.name, 'profile_list': profile_list,
No newline at end of file
65 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,}) No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now