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
# Dockerfile | |
# Pull base image | |
FROM python:3.7-buster | |
# create and set working directory | |
RUN mkdir /code | |
WORKDIR /code | |
# Add current directory code to working directory |
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
# views.py | |
from django.db.models import F | |
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 rest_framework import status | |
from .models import GlobalVariable | |
from .serializers import GlobalVariablesSerializer |
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
# views.py | |
from django.db.models import F | |
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 | |
from .serializers import GlobalVariablesSerializer, StateSerializer |
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
<script src="https://unpkg.com/vue/dist/vue.js"></script> | |
<div id="exercise"> | |
<!-- 1) Fill the <p> below with your Name and Age - using Interpolation --> | |
<p>VueJS is pretty cool - {{ name }} ({{ age }})</p> | |
<!-- 2) Output your age, multiplied by 3 --> | |
<p>{{ age * 3}}</p> | |
<!-- 3) Call a function to output a random float between 0 and 1 (Math.random()) --> | |
<p>{{ random() }}</p> | |
<!-- 4) Search any image on Google and output it here by binding the "src" attribute --> |
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
``` | |
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 |
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 | |
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' |
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
# 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: |
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
# 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'), | |
] |
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
{ | |
"data":{ | |
"version":"v1", | |
"negotiation":{ | |
"batch_type":"crusher_run" | |
}, | |
"characteristics":{ | |
"species":"arabica", | |
"origin":155, |
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
""" | |
Problema. | |
Uma entrada de valores numéricos (uma lista deles) | |
3x -> Queijo | |
5x -> Goiabada | |
3x e 5x -> romeu e Julieta | |
Base dos testes: |