Name: ruff-format
Program: $PyInterpreterDirectory$/ruff
Arguments: format .
Working directory: $ProjectFileDir$Dockerfile
FROM debian:bookworm-slim
RUN apt update && apt install -y lftpSend from terminal
docker run -v $(pwd)/file_to_send:/tmp/file_to_send \
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
| """ | |
| Short example of how to set realtionship in many-to-many with extra column(s) in association table. | |
| creator class is used on the relationship(), but it's also possible to create MUserPermitAssoc | |
| explicitly and pass it to MUser.permits. | |
| """ | |
| from __future__ import annotations | |
| import sqlalchemy as sa |
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
| class MyCUstomResponse(JSONResponse): | |
| def __init__( | |
| self, | |
| data: list[t.Any], | |
| errors: list[t.Any] | None = None, | |
| status_code: int = 200, | |
| headers: dict[str, str] | None = None, | |
| media_type: str | None = None, | |
| background: BackgroundTask | None = None, | |
| ) -> None: |
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 re | |
| from sqlalchemy.orm import DeclarativeBase, declared_attr | |
| def resolve_table_name(name): | |
| """Resolve table name from Class CamelCase""" | |
| # Match a letter just before an upper-case char | |
| # Example: "Hello World" would match "o" because next "W" is uppercase. |
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
| class AsyncTyper(typer.Typer): | |
| def __init__(self, *args, **kwargs): | |
| kwargs["no_args_is_help"] = True | |
| super().__init__(*args, **kwargs) | |
| def async_command(self, *args, **kwargs): | |
| def decorator(async_func): | |
| @wraps(async_func) | |
| def sync_func(*_args, **_kwargs): |
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 sqlalchemy.engine import Connection | |
| from sqlalchemy.ext.asyncio import AsyncEngine | |
| from app.core.config import get_config | |
| app_config = get_config() | |
| config.set_main_option("sqlalchemy.url", app_config.postgres.dsn) |