python manage.py createsuperuser
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
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete | |
find . -path "*/migrations/*.pyc" -delete |
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
WAITING |
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
INSERT INTO django_content_type (app_label, model) VALUES ('afiliados', 'promocao'); | |
INSERT INTO auth_permission (name, content_type_id, codename) SELECT 'Can add promoção', id, 'add_promocao' FROM django_content_type WHERE model = 'promocao'; | |
INSERT INTO auth_permission (name, content_type_id, codename) | |
SELECT 'Can change promoção', id, 'change_promocao' FROM django_content_type WHERE model = 'promocao'; | |
INSERT INTO auth_permission (name, content_type_id, codename) | |
SELECT 'Can delete promoção', id, 'delete_promocao' FROM django_content_type WHERE model = 'promocao'; |
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
UPDATE academico_cobranca | |
SET hash_cobranca = SHA1(CONCAT(id, aluno_id, titulo_id)) | |
WHERE hash_cobranca IS NULL |
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
{ | |
"previsto": [{ | |
"total": 250, | |
"pontuacao": 194 | |
}], | |
"recebidos": [{ | |
"total": 0, | |
"pontuacao": 0 | |
}], | |
"dados": [{ |
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
UPDATE financeiro_titulo AS t | |
INNER JOIN academico_cobranca AS c ON (c.titulo_id = t.id) | |
INNER JOIN academico_aluno AS a ON (c.aluno_id = a.id) | |
SET t.cpf_cnpj = a.cpf_cnpj | |
WHERE t.cpf_cnpj IS NULL |
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
from datetime import datetime | |
date = '1994-09-27' | |
# str | |
type(date) | |
# datetime.datetime | |
type(datetime.strptime(date, '%Y-%m-%d')) |
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
#!/usr/bin/python | |
import MySQLdb | |
itens = ['(', ')', ' ', '-', '.', '?'] | |
def replace_all(lista_itens, telefone): | |
for i in range(len(lista_itens)): | |
telefone = telefone.replace(lista_itens[i], '') | |
return telefone |
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
form = FormAlunoSaude(request.POST) | |
if form.is_valid(): | |
aluno_saude = form.save(commit=False) | |
aluno_saude.cadastrado_por = request.user | |
aluno_saude.alterado_por = request.user | |
aluno_saude.save() | |
return JsonResponse({'sucesso': 1}) | |
else: | |
return JsonResponse({'errors:': form.errors.as_json()}) |
NewerOlder