An open-source, self-hosted note-taking service. Your thoughts, your data, your control — no tracking, no ads, no subscription fees.
Bem-vindo ao guia prático de Go!
Aqui você encontra resumos e exemplos essenciais para aprender a linguagem Go do zero, com explicações em português e comparações com Python.
Este material é organizado em tópicos curtos e objetivos, ideais para consulta rápida ou estudo inicial.
The script below shows how to add the collapse button to the django admin filters.
In the static directory, which is configured in the django settings STATICFILES_DIRS, create the file changelist_filter_collapse.js inside /admin/js. For example, if your STATICFILES_DIRS is mapped to the statics directory, the file would look like this /statics/admin.js/changelist_filter_collapse.js.
// changelist_filter_collapse.js
// The original code for the snippet is here: https://gist.github.com/duducp/0c5b32f7936b924b39c10e5983de1199#file-changelist-filter-collapse-md
// Wait for the DOM to be fully loaded before running the script
document.addEventListener('DOMContentLoaded', function() {É usada para indicar o propósito ou a intenção de uma ação. Geralmente, é seguida por um verbo no infinitivo.
| from types import TracebackType | |
| from asgiref.sync import sync_to_async | |
| from django.db.transaction import Atomic as _Atomic | |
| __all__ = ["AtomicAsync", "Atomic"] | |
| class AtomicAsync(_Atomic): | |
| """ |
| from threading import Semaphore, Thread | |
| from time import sleep | |
| # Número máximo de threads a serem execultadas simultaneamente | |
| control_threads = Semaphore(5) | |
| def view_log(number: int): | |
| with control_threads: | |
| print(f'O número atual é: {number}') |