Skip to content

Instantly share code, notes, and snippets.

View pedrohsbarbosa99's full-sized avatar
🎯
Focusing

Pedro barbosa pedrohsbarbosa99

🎯
Focusing
  • Napp Solutions
  • Brazil
View GitHub Profile

Hi, I'm Pedro Barbosa !

Sobre :


  • Atualmente sou estudante de Python e Django.
  • Estou aprendendo sobre algoritimos em python.
  • Futuros objetivos: aprender sobre desenvolvimento backend Web.
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
})
{% 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>
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")
{% 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>
@pedrohsbarbosa99
pedrohsbarbosa99 / _head.html
Created November 16, 2020 22:17
Mask input
{% 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' %}">
from django.contrib import admin
from .models import Category, Contact
admin.site.register(Category)
admin.site.register(Contact)
<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">
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)
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