This file contains 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
from django import forms | |
class MeuForm(forms.Form): | |
campo1 = forms.CharField(label="Campo 1") | |
def __init__(self, *args, **kwargs): | |
super(MeuForm, self).__init__(*args, **kwargs) | |
self.fields["campo1"].widget.attrs["class"] = "classe_css1" |
This file contains 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
continuar = True | |
nome_vencedor = '' | |
pontos_vencedor = -1 | |
vitorias_vencedor = -1 | |
gols_a_favor_vencedor = -1 | |
gols_sofridos_vencedor = -1 | |
saldo_vencedor = None | |
while continuar: |
This file contains 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
# -*- coding: utf-8 -*- | |
import numpy as np | |
def mmq(x, y): | |
u""" | |
x é uma matriz com as variáveis independentes | |
y é um array com a variável dependente | |
O retorno é um array contendo os valores dos beta's | |
""" |
This file contains 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
package com.mkyong.io; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class BufferedReaderExample { | |
public static void main(String[] args) { | |
This file contains 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
from django.forms.widgets import CheckboxSelectMultiple | |
from django import forms | |
from .models import Curriculo | |
class CurriculoForm(forms.ModelForm): | |
class Meta: | |
model = Curriculo |
This file contains 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
(function($) { | |
$.fn.selectAll = function(options) { | |
var defaults = { | |
inputs: 'input[name=ids]', | |
selectAll: "#select_all", | |
selected: false | |
}; | |
var settings = $.extend(defaults, options); | |
return this.each(function(x) { | |
var table = $(this); |
This file contains 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
from django.db import models | |
class Propriedade(models.Model): | |
pass | |
class PropriedadeRef(models.Model): | |
This file contains 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
bind = '127.0.0.1:9999' | |
workers = 2 | |
logfile = '/tmp/gunicorn_project.log' |
This file contains 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
# -*- coding: utf-8 -*- | |
import posixpath | |
import urllib | |
import os | |
from django.conf import settings | |
from django.views.static import serve | |
from django.http import HttpResponse | |
from django.utils.encoding import smart_str |
This file contains 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
{% if is_paginated %} | |
<div class="pagination pagination-right"> | |
<ul> | |
{% if page_obj.has_previous %} | |
<li> | |
<a href="?page={{ page_obj.previous_page_number }}{{ getvars }}">‹‹ anterior</a> | |
</li> | |
{% endif %} | |
{% for page in pages %} | |
{% if page %} |