[Python/FastAPI/ODMantic] TypeError: field Config is defined without type annotation

2024. 6. 19. 15:55·Minding's Programming/에러 코드
728x90
반응형

인프런의 '파이썬 동시성 프로그래밍 : 데이터 수집부터 웹 개발까지 (feat. FastAPI)' 강의를 수강하다가 발생한 에러코드.

서버를 실행할 때 마다 위와 같은 에러가 발생했다.

https://art049.github.io/odmantic/modeling/

 

Modeling - ODMantic

Modeling Models To create a Model, simply inherit from the Model class and then specify the field types and eventually their descriptors. Collection Each Model will be linked to its own collection. By default, the collection name will be created from the c

art049.github.io

공식 문서를 확인해보니, 강의 코드 버전과 다르게 odmantic의 모델링 코드가 변경된 듯하다.

 

# book.py

# 강의에 나오는 코드
class Config:
    collection = "books"

# 수정한 코드
model_config = {"collection": "books"}

Config 클래스를 없애고 아래와 같이 코드를 수정했다.

728x90

'Minding's Programming > 에러 코드' 카테고리의 다른 글

SQLAlchemy QueuePool 에러 해결하기 (sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00)  (0) 2025.03.20
Python 프로그래밍 중 가장 많이 발생하는 5가지 에러코드 정리  (0) 2023.08.08
ModuleNotFoundError: No module named 'sklearn.utils.linear_assignment_'  (0) 2021.04.01
[에러코드/DeepSort] KeyError: "The name 'net/images:0' refers to a Tensor which does not exist. The operation, 'net/images', does not exist in the graph."  (0) 2021.04.01
AttributeError: module 'tensorflow' has no attribute 'gfile'  (0) 2021.04.01
'Minding's Programming/에러 코드' 카테고리의 다른 글
  • SQLAlchemy QueuePool 에러 해결하기 (sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00)
  • Python 프로그래밍 중 가장 많이 발생하는 5가지 에러코드 정리
  • ModuleNotFoundError: No module named 'sklearn.utils.linear_assignment_'
  • [에러코드/DeepSort] KeyError: "The name 'net/images:0' refers to a Tensor which does not exist. The operation, 'net/images', does not exist in the graph."
Minding
Minding
  • Minding
    Today's Minding
    Minding
  • 전체
    오늘
    어제
    • 울고넘는 딥러닝 (278)
      • Minding's Baseball (57)
        • MLB Statcast (29)
        • 머신러닝으로 홈런왕 예측하기 (3)
        • 야구칼럼 (12)
        • 야구 규칙, 용어 (1)
        • 2022-23 질롱 코리아 (8)
        • 류현진 등판경기 (4)
      • Minding's Programming (185)
        • 프로그래머스 코딩테스트 (21)
        • Knowledge (44)
        • Numpy & Pandas (6)
        • Excel (3)
        • Git (1)
        • Pygame (11)
        • CV (3)
        • Tensorflow tutorial (4)
        • Kaggle and Dacon (4)
        • 에러 코드 (8)
        • FastAPI (8)
        • Airflow (29)
        • Crawling (6)
        • Django (14)
        • AWS (18)
        • Spark (5)
      • Minding's Reading (30)
        • 머신러닝 딥러닝에 필요한 기초 수학 with 파이.. (2)
        • 칼만필터는 어렵지 않아 (11)
        • 밑바닥부터 시작하는 딥러닝 (6)
        • 메이저리그 야구 통계학 2e (8)
        • 논문읽기 (2)
        • 빅데이터를 지탱하는 기술 (1)
      • Minding's Life (5)
        • 주식 (4)
        • 각종 소식 (1)
  • 블로그 메뉴

    • 홈
    • Baseball
    • Programming
    • Reading
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    파이썬
    데이터분석
    게임개발
    MLB
    FastAPI
    pygame
    넘파이
    AWS
    질롱코리아
    Airflow
    메이저리그
    칼만필터는어렵지않아
    파이게임
    파이썬게임개발
    django
    django python
    딥러닝
    머신러닝
    mlb stats api
    코딩테스트
    프로그래머스
    에어플로우
    야구
    칼만필터는어렵지않아파이썬
    Python
    KBO
    칼만필터
    데이터 엔지니어
    KalmanFilter
    칼만필터는어렵지않아python
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
Minding
[Python/FastAPI/ODMantic] TypeError: field Config is defined without type annotation
상단으로

티스토리툴바