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
Example to drop a column title in a posts table: | |
# Generate by Alembic | |
def downgrade(): | |
# ### commands auto generated by Alembic - please adjust! ### | |
op.drop_index(op.f('ix_posts_title'), table_name='posts') | |
op.drop_column('posts', 'title') | |
$ flask db downgrade | |
.... |
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 the book, effective python 2nd edition item 37 | |
from collections import defaultdict | |
from dataclasses import dataclass, field | |
from typing import List, Dict | |
@dataclass | |
class Grade: | |
weight: int |
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 math | |
import typing | |
import hashlib | |
from dataclasses import dataclass, field | |
from pathlib import Path | |
@dataclass(order=True) | |
class ReferenceGenome: |
NewerOlder