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 django.db import models | |
| # Create your models here. | |
| class Escola(models.Model): | |
| nome = models.CharField(max_length=255) | |
| # __unicode__ on Python 2 | |
| def __str__(self): | |
| return self.nome |
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
| <article class="container"> | |
| <div class="row"> | |
| <div class="col-xs-6">Nome:</div> | |
| <div class="col-xs-6">{{ escola.nome }}</div> | |
| </div> | |
| <div class="row"> | |
| <div class="col-xs-6">Segmentos:</div> | |
| <div class="col-xs-6"> | |
| {% if segmentos %} | |
| <ul> |
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 django.http import HttpResponse | |
| from django.template import loader | |
| from .models import Escola, EscolaSegmento, Serie, Turma | |
| #.... outras views ... | |
| def escola(request, escola_id): | |
| escola = Escola.objects.get(id=escola_id) |
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
| class PeriodoLetivo(models.Model): | |
| nome = models.CharField(max_length=255) | |
| escolasegmento = models.ForeignKey(EscolaSegmento, on_delete=models.CASCADE) | |
| inicio = models.DateField() | |
| fim = models.DateField() | |
| # __unicode__ on Python 2 | |
| def __str__(self): | |
| return self.nome +" - "+ self.escolasegmento.segmento.nome +" - "+ self.escolasegmento.escola.nome +" (de "+ self.inicio.strftime("%d/%m/%Y") +" até "+ self.fim.strftime("%d/%m/%Y") +")" |
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
| class Area(models.Model): | |
| nomecurso = models.CharField(max_length=255) | |
| instituicao = models.CharField(max_length=255) | |
| # __unicode__ on Python 2 | |
| def __str__(self): | |
| return self.nome | |
| class Disciplina(models.Model): | |
| nome = models.CharField(max_length=255) |
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
| {{extend 'layout/base.html'}} | |
| <section class="container"> | |
| <div class="row"> | |
| <div class="col-xs-4"></div> | |
| <div class="col-xs-4"> | |
| <h2>Less asphalt, more trees.</h2> | |
| <p> </p> | |
| <form> | |
| <input type="text" name="search" class="form-control" /> |
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
| <!Doctype html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>{{block title}}GreenMap{{end}}</title> | |
| <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> | |
| <!-- Latest compiled and minified CSS --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
| <!-- Optional theme --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> |
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 weppy import App | |
| app = App(__name__) | |
| @app.route('/') | |
| def hello(): | |
| return dict(title="Welcome - GreenMap") | |
| if __name__ == "__main__": |
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
| """ | |
| Análise inicial da autonomia do combustível (gasolina) de um veículo para uma viagem, ajudando a prever a probabilidade de faltar gasolina. | |
| Cálculo incompleto, use por sua conta e risco. | |
| Precisa de refatoração. | |
| """ | |
| class Fabricante(object): | |
| nome = '' | |
| def __init__(self, nome): |
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
| class N: | |
| attr = 10 | |
| n1 = N | |
| n2 = N | |
| print(n1.attr) | |
| print(n2.attr) |