Docker-Compse & Django Tutorial
Enter Container CLI: docker exec -it <running container ID> bash
<form method='POST'> | |
{% csrf_token %} | |
{{ ssformset.management_form }} | |
{{ ssformset.non_form_errors }} | |
<div id="form-list"> | |
{% for form in ssformset %} | |
<div id="form-set"> | |
{% for field in form %} | |
<div class="form-group"> | |
<div class="row"> |
var pk_list = []; | |
$('#forecast_table').on('click', '#add_to_list', function(){ | |
var this_val = parseInt($(this).val()); | |
if($(this).html() == 'Add to List'){ | |
$(this).removeClass('btn-primary').addClass('btn-danger').html('Remove from List') | |
pk_list.push(this_val); | |
}else{ | |
$(this).addClass('btn-primary').removeClass('btn-danger').html('Add to List') | |
pk_list.splice($.inArray(this_val, pk_list), 1); | |
} |
Docker-Compse & Django Tutorial
Enter Container CLI: docker exec -it <running container ID> bash
# Instantiated | |
function panelHeight(indexStart, greaterIndex){ | |
if($(window).width() > 975){ | |
var tallestHeight = 0; | |
for(i=indexStart; i<greaterIndex; i++){ | |
var testHeight = $(".panel-body:eq(" + i + ")").outerHeight(); | |
if(testHeight > tallestHeight){ | |
tallestHeight = testHeight; | |
}; | |
}; |
[program:calib] | |
directory=/home/joswar/projects/calibration/ | |
environment=DJANGO_SETTINGS_MODULE=calib_site.settings.testdev | |
command=/home/joswar/envs/calibration/bin/gunicorn -c conf/gunicorn_conf_prod.py calib_site.wsgi:application | |
redirect_stderr=true | |
autostart=true | |
autorestart=true | |
user=joswar | |
priority=990 | |
stopsignal=KILL |
server { | |
server_name 10.6.0.85; | |
listen 112; | |
keepalive_timeout 5; | |
location /static { | |
alias /home/joswar/projects/calibration/static/; | |
autoindex on; | |
} | |
location /media { | |
alias /home/joswar/projects/calibration/media/; |
workers = 1 | |
bind = '127.0.0.1:8085' | |
proc_name = 'calibration' |
Using jQuery to hide and show fields. Making sure to clear fields if they are not longer appropriate. Using Select2 with json and ajax is better than hard coding options.
$(document).ready(function(){
// Hide SNMP fields if not already selected, also Hides/Shows closest div with no Id or Class
if($('#id_check_cmd').val() != 3) {
$("#id_snmp_type").closest(".mws-form-col-5-8").hide()
$("#id_snmp_oid").closest(".mws-form-col-5-8").hide()