Skip to content

Instantly share code, notes, and snippets.

View alisonamerico's full-sized avatar
🐍
💻 Working from 🏠

Alison Américo alisonamerico

🐍
💻 Working from 🏠
  • Recife, Brasil
View GitHub Profile
@alisonamerico
alisonamerico / cloudSettings
Last active June 25, 2020 18:51 — forked from heroheman/ranger-cheatsheet.md
Ranger Cheatsheet
{"lastUpload":"2020-06-25T18:51:04.997Z","extensionVersion":"v3.4.3"}
@alisonamerico
alisonamerico / git.md
Created April 10, 2020 19:51 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

"""
Exercício:
1 - Escreva um programa que recebe como entrada um username e retorna as seguintes informações:
e-mail
website
hemisfério (norte ou sul)
A fonte de dados original é a seguinte API:
https://jsonplaceholder.typicode.com/users
"""
Exercício:
1 - Escreva um programa que recebe como entrada um username e retorna as seguintes informações:
e-mail
website
hemisfério (norte ou sul)
A fonte de dados original é a seguinte API:
https://jsonplaceholder.typicode.com/users
"""
Problema.
Uma entrada de valores numéricos (uma lista deles)
3x -> Queijo
5x -> Goiabada
3x e 5x -> romeu e Julieta
Base dos testes:
{
"data":{
"version":"v1",
"negotiation":{
"batch_type":"crusher_run"
},
"characteristics":{
"species":"arabica",
"origin":155,
# Generated by Django 2.0.5 on 2020-01-13 18:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('schemas', '0021_add_packing_type_and_allow_negotiation'),
]
# models.py
from django.db import models
class Country(models.Model):
id = models.AutoField(db_column='ID_COUNTRY', primary_key=True)
name = models.CharField(db_column='NAME', max_length=30)
initials = models.CharField(db_column='INITIALS', max_length=4, blank=True, null=True)
class Meta:
from django.db import models
class Country(models.Model):
id = models.AutoField(db_column='ID_COUNTRY', primary_key=True)
name = models.CharField(db_column='NAME', max_length=30)
initials = models.CharField(db_column='INITIALS', max_length=4, blank=True, null=True)
class Meta:
managed = False
db_table = 'COUNTRY'
```
views.py
from django.db.models import F
from rest_framework.exceptions import ValidationError
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.status import HTTP_201_CREATED, HTTP_409_CONFLICT, HTTP_400_BAD_REQUEST
from .models import GlobalVariable, Variable, Unity, State