- Atualmente sou estudante de Python e Django.
- Estou aprendendo sobre algoritimos em python.
- Futuros objetivos: aprender sobre desenvolvimento backend Web.
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
def rep_class(request): | |
dateclasses = DateClass.objects.order_by('date_hour') | |
start_date = datetime.today() | |
end_date = datetime.today() + timedelta(days=15) | |
dateclasses = dateclasses.filter( | |
date_hour__range=[start_date, end_date] | |
) | |
return render(request, 'report/class.html', { | |
'dateclasses': dateclasses | |
}) |
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
{% extends 'base.html' %} | |
{% block content %} | |
<div class="container"> | |
<h1 class="mt-5">Agendamentos</h1> | |
<table class="table"> | |
<thead class="thead-dark"> | |
<tr> | |
<th>ID</th> |
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
class Day(models.Model): | |
DAY_CHOICES = ( | |
('SEG', 'Segunda'), | |
('TER', 'Terça'), | |
('QUA', 'Quarta'), | |
('QUI', 'Quinta'), | |
('SEX', 'Sexta') | |
) | |
day = models.CharField(max_length=3, choices=DAY_CHOICES, blank=False, | |
null=False, verbose_name="Dia da semana") |
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
{% extends 'base.html' %} | |
{% block content %} | |
<h1 class="mt-5">Minha agenda</h1> | |
<table class="table"> | |
<thead class="thead-dark"> | |
<tr> | |
<th>ID</th> | |
<th>Nome</th> | |
<th>Sobrenome</th> |
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
{% load static %} | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Bootstrap core CSS --> | |
<link href="{% static 'vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet"> | |
<link href="{% static 'vendor/js/scripts.js' %}"> |
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.contrib import admin | |
from .models import Category, Contact | |
admin.site.register(Category) | |
admin.site.register(Contact) |
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
<div class="container"> | |
{% for next_days in next_four_days %} | |
<div class="card"> | |
<div class="card" id="cards_next_days"> | |
{% if '{{ next_days.min }}' == 12 %} | |
<img src="{% static 'icons/parcialmente-nublado.png' %}" style="margin-left: 10px;" width="80" height="80"> | |
{% elif '{{ next_days.min }}' == 13 %} | |
<img src="{% static 'icons/1.jpg' %}" style="margin-left: 10px;" width="80" height="80"> | |
{% endif %} | |
<div class="info"> |
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 Categoria(models.Model): | |
nome = models.CharField(max_length=100) | |
class Produtos(models.Model): | |
prod_nome = models.CharField(max_length=250) | |
qtd_estoque= models.IntegerField() | |
preco = models.DecimalField(max_digits=8, decimal_places=2) | |
categoria = models.ForeignKey(Categoria, on_delete=models.CASCADE, default=None) |
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.conf import settings | |
import requests | |
def get_tempo(): | |
token = settings.API_TOKEN | |
r = requests.get('https://api.hgbrasil.com/weather?key={}&user_ip=remote'.format(token)) | |
data = r.json() | |
dados_list = data['results'] | |
return dados_list |
NewerOlder