This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import re | |
iplist = [] | |
with open('level3.db.new') as myfile: | |
for line in myfile.readlines(): | |
if line.startswith('member'): | |
iplist.append(re.findall(r'[0-9]+(?:\.[0-9]+){3}(?:\/[0-9]+)', line)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = request.POST | |
for d in data: | |
jsondata = json.loads(d) | |
for item in jsondata['itens']: | |
print(item) | |
print(item['id_nome']) | |
# @DICA ... Se você usar os mesmos nomes de campos do seu modelo, você pode inserir os dados assim | |
modelo.objects.create(** item ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#datetimepicker2').change(function(){ | |
var total_parcelas = $('#num_parcela').val(); | |
var quant_parcela = $('#quant').val(); | |
var total = parseFloat(produto.preco) * quant_parcela; | |
subtotal = total; | |
total = total.toFixed(2); | |
var valor_parcela = parseFloat(subtotal) / total_parcelas; | |
valor_parcela = valor_parcela.toFixed(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#datetimepicker2').change(function(){ | |
var total_parcelas = $('#num_parcela').val(); | |
var quant_parcela = $('#quant').val(); | |
var total = parseFloat(produto.preco) * quant_parcela; | |
subtotal = total; | |
total = total.toFixed(2); | |
var valor_parcela = parseFloat(subtotal) / total_parcelas; | |
valor_parcela = valor_parcela.toFixed(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#datetimepicker2').change(function(){ | |
var total_parcelas = $('#num_parcela').val(); | |
var quant_parcela = $('#quant').val(); | |
var total = parseFloat(produto.preco) * quant_parcela; | |
subtotal = total; | |
total = total.toFixed(2); | |
var valor_parcela = parseFloat(subtotal) / total_parcelas; | |
valor_parcela = valor_parcela.toFixed(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variável no escopo global. | |
var subtotal = 0; | |
$('#cod_produto').keyup('change', function(){ | |
$('#inserir').unbind('click'); | |
$('#quant').get(0).selectedIndex = 0; | |
$.ajax({ | |
type:"GET", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
function getCookie(name) | |
{ | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qtd_produtos = 0; | |
$('#inserir').click(function(){ | |
var quant = $('#quant').val() | |
var total = data.preco * quant | |
$('#tabela_pedido').append("<tr>"+ | |
"<td name='id_codigo'" + qtd_produtos + "><b>" + data.codigo + "</b></td>"+ | |
"<td name='id_nome'" + qtd_produtos + ">" + data.nome +" </td>"+ | |
"<td>" + data.descricao +" </td>"+ | |
"<td name='id_quant'" + qtd_produtos + ">" + quant + "</td>"+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** ** | |
* Fun��o respons�vel por remover os campos de procedimentos. | |
* Somente ativo se for diferente de consulta ;) | |
*/ | |
$(function() { | |
//@TODO --> Verificar quantidade limite de procedimentos ... | |
//@TODO --> N�o criar box se descri��o estiver vazia =D | |
//fadeout selected item and remove | |
$('.remove').live('click', function() { | |
$(this).parent().fadeOut(300, function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: Verificar se questões estão na lista para serem exportadas... | |
if export.selected_questions: | |
data['questions'] = [ | |
q for q in data['questions'] if q in | |
export.selected_questions['selected_questions']] |