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 (namespace, $) { | |
"use strict"; | |
var DemoCalendar = function () { | |
// Create reference to this instance | |
var o = this; | |
// Initialize app when document is ready | |
$(document).ready(function () { | |
o.initialize(); | |
}); |
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
#View bookings_create | |
def bookings_create(request): | |
data = dict() | |
if request.method == 'POST': | |
form = BookingsForm(request.POST) | |
if form.is_valid(): | |
form.save() | |
data['form_is_valid'] = True | |
else: |
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 kivy.network.urlrequest import UrlRequest | |
from kivy.app import App | |
from kivy.uix.button import Button | |
class reqApp(App): | |
def build(self): | |
bt = Button(text='Pegar Json do Bitcoin') | |
bt.bind(on_press=self.make_request) |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
import urllib.parse, urllib.request | |
import http.client, http.cookiejar | |
cookie = http.cookiejar.CookieJar() | |
conn = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cookie)) | |
#self._conn.addheaders = [('Content-Type', 'multipart/form-data')] | |
url = 'http://localhost/api/login' | |
url_todos = 'http://localhost/api/list_todos' |
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
#Modelos | |
class Questions(models.Model): | |
LEVEL_CHOICES = ( | |
('0', 'Indefinido'), | |
('1', 'Dependencia'), | |
('2', 'Confianca'), | |
('3', 'Comprometimento'), | |
('4', 'Preditiva'), | |
('5', 'Comprometimento'), | |
) |
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
#Minha view | |
def addQuestions(self): | |
person = Person.objects.get(pk=1) | |
questions = Questions.objects.all() | |
for question in questions: | |
Pesquisa.objects.get_or_create( | |
search_key='092018', | |
person=person, | |
question=question, |
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
#View para post e get do formset | |
class QuestionsDetailWiew(TemplateView): | |
template_name = 'queryes.html' | |
def get_formset(self, clear=False): | |
QuestionsFormSet = modelformset_factory( | |
Pesquisa, fields=('response',), can_delete=False, extra=0 | |
) | |
if clear: | |
formset = QuestionsFormSet( |
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
import os | |
import django | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dccrecibo.settings") | |
django.setup() | |
#from django.utils.text import slugfy | |
from dccrecibo.core.models import Person | |
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 | |
from django.urls import reverse | |
class Question(models.Model): | |
LEVEL_CHOICES = ( | |
('0', 'Dependencia'), | |
('1', 'Confianca'), | |
('2', 'Comprometimento'), | |
('3', 'Preditiva'), |
OlderNewer