This is an unofficial manual for the couchdb
Python module I wish I had had.
pip install couchdb
/* | |
Notes: | |
Despite Scala's appearances, it is, in fact, a Statically Typed language. | |
It has just eliminated a great deal of the "type vomit" people are used | |
to seeing in Statically Typed languages (e.g. C, C++, Java). It often | |
can infer the type on its own. It also combines functional and | |
object-oriented programming paradigms in a fashion that feels similar | |
to Python. | |
*/ |
import csv | |
import sys | |
import os | |
# example usage: python split.py example.csv 200 | |
# above command would split the `example.csv` into smaller CSV files of 200 rows each (with header included) | |
# if example.csv has 401 rows for instance, this creates 3 files in same directory: | |
# - `example_1.csv` (row 1 - 200) | |
# - `example_2.csv` (row 201 - 400) | |
# - `example_3.csv` (row 401) |
This is an unofficial manual for the couchdb
Python module I wish I had had.
pip install couchdb
# import config. | |
# You can change the default config with `make cnf="config_special.env" build` | |
cnf ?= config.env | |
include $(cnf) | |
export $(shell sed 's/=.*//' $(cnf)) | |
# import deploy config | |
# You can change the default deploy config with `make cnf="deploy_special.env" release` | |
dpl ?= deploy.env | |
include $(dpl) |
from leilao.models import LanceProgramado | |
leilao = 'SEOP15-17' | |
lote = 2795 | |
username = 'shirlene' | |
LanceProgramado.objects.filter( | |
lote__numero_do_lote_no_leilao=lote, | |
lote__leilao__nome=leilao, | |
user__username=username).values_list('ativo', flat=True) |
from novo_financeiro.models import * | |
leilao = 'DIVSC05-17' | |
for nota in Nota.objects.filter(cache_dicionario__contains=leilao): | |
dicionario = nota.dicionario_do_cache() | |
dicionario['taxas'] = 0 | |
nota.cache_dicionario = json.dumps(dicionario, cls=DjangoJSONEncoder) | |
nota.save() |
In general, you will learn some markdown tricks combined with standard HTML tags. In more details what you will learn:
""" | |
Single Responsibility Principle | |
“…You had one job” — Loki to Skurge in Thor: Ragnarok | |
A class should have only one job. | |
If a class has more than one responsibility, it becomes coupled. | |
A change to one responsibility results to modification of the other responsibility. | |
""" | |
class Animal: | |
def __init__(self, name: str): |