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
# https://groups.google.com/forum/?fromgroups#!topic/django-brasil/d6gV1V9qrgU | |
from django.forms import ModelForm | |
from minha_app.models import MeuModel | |
class MeuForm(ModelForm): | |
class Meta: | |
model = MeuModel |
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
import json | |
import requests | |
BASE_URL = 'https://192.168.6.35/cgi-bin' | |
API = { | |
'apply': BASE_URL+'/api/v3/system/apply', | |
'login': BASE_URL+'/api/v3/system/login', | |
'service_led': BASE_URL+'/api/v3/service/leds', | |
'service_ssh': BASE_URL+'/api/v3/service/ssh', |
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
{ | |
"workbench.startupEditor": "newUntitledFile", | |
"editor.fontSize": 16, | |
"editor.lineHeight": 1.8, | |
"javascript.suggest.autoImports": true, | |
"javascript.updateImportsOnFileMove.enabled": "always", | |
"editor.rulers": [ | |
80, | |
120 | |
], |
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
# Font: https://www.caktusgroup.com/blog/2018/10/18/filtering-and-pagination-django/ | |
class FilteredListView(ListView): | |
filterset_class = None | |
def get_queryset(self): | |
# Get the queryset however you usually would. For example: | |
queryset = super().get_queryset() | |
# Then use the query parameters and the queryset to | |
# instantiate a filterset and save it as an 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
#!/bin/bash | |
# Executar comandos a seguir para atualizar os pacotes | |
sudo apt update -y | |
sudo apt upgrade -y | |
# Só o Python | |
sudo apt install python3.10-full python3.10-dev -y | |
# Instalar pacotes a seguir |