This guide demonstrates the four common types of relationships in SQLAlchemy using realistic examples:
-
✅ One-to-One:
User→UserProfile -
✅ One-to-Many:
Blog→BlogPost
Notes for software engineering meeting presentation
| import phonenumbers | |
| from pydantic.validators import strict_str_validator | |
| class PhoneNumber(str): | |
| """Phone Number Pydantic type, using google's phonenumbers""" | |
| @classmethod | |
| def __get_validators__(cls): | |
| yield strict_str_validator | |
| yield cls.validate |
| from typing import Any | |
| from typing import Dict | |
| from typing import Set | |
| from typing import Type | |
| from pydantic import SecretStr | |
| from pydantic.utils import update_not_none | |
| class Password(SecretStr): |
| # Add in ~/.bashrc or ~/.bash_profile | |
| function parse_git_branch () { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| RED="\[\033[01;31m\]" | |
| YELLOW="\[\033[01;33m\]" | |
| GREEN="\[\033[01;32m\]" | |
| BLUE="\[\033[01;34m\]" | |
| NO_COLOR="\[\033[00m\]" |