delete backward - Ctrl + W
delete forward - Alt + D
| indenter: | |
| find backend -name "*.html" | xargs djhtml -t 2 | |
| autopep8: | |
| find backend -name "*.py" | xargs autopep8 --max-line-length 120 --in-place | |
| isort: | |
| isort -m 3 * --skip migrations --skip .venv | |
| lint: autopep8 isort indenter | 
| function group_by_date(transactions) { | |
| /* | |
| Agrupa os dados por data. | |
| */ | |
| // Dicionário vazio | |
| const result = {} | |
| for (const transaction of transactions) { | |
| // Adiciona uma chave no dicionário | |
| const date = transaction['date'] | 
| #!/bin/bash | |
| # Run this code with manager.py folder. | |
| # Usage: $ ~/.dj_scaffold.sh crm person | |
| <<comment | |
| Create templates | |
| * _list.html | |
| * _detail.html | 
| def get_fields_verbose_names(self): | |
| return [{'name': field.verbose_name, 'value': getattr(self, field.name)} for field in self._meta.fields] | 
delete backward - Ctrl + W
delete forward - Alt + D
| def save_data(data, form_class, model, field) -> bool: | |
| ''' | |
| Adiciona um novo valor no FK vindo do select do form. | |
| Usando select2 com tags:true no select. | |
| field_name: Nome do campo no form. | |
| field_name_fk: Nome do campo na tabela ForeignKey. | |
| field_value: Valor do campo field_name. | |
| ''' | |
| field_name, field_name_fk, field_value = field | 
 
        json-server -w db.json
Port 3000
| import uuid | |
| from datetime import datetime | |
| from pprint import pprint | |
| import click | |
| import yaml | |
| from utils import datetime_to_string | |
| FILENAME = 'report_test.yml' | |
| # limit the task_type enum add just add an valid one |